Class: UpdatePANAPI

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



36817
36818
36819
36820
36821
36822
# File 'lib/schemas.rb', line 36817

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    api: d["api"] ? UpdatePanAPIAPI.from_dynamic!(d["api"]) : nil,
  )
end

.from_json!(json) ⇒ Object



36824
36825
36826
# File 'lib/schemas.rb', line 36824

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



36828
36829
36830
36831
36832
# File 'lib/schemas.rb', line 36828

def to_dynamic
  {
    "api" => api&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



36834
36835
36836
# File 'lib/schemas.rb', line 36834

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end