Class: PostCollectionsResponse500

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



22664
22665
22666
22667
22668
22669
# File 'lib/schemas.rb', line 22664

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

.from_json!(json) ⇒ Object



22671
22672
22673
# File 'lib/schemas.rb', line 22671

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

Instance Method Details

#to_dynamicObject



22675
22676
22677
22678
22679
# File 'lib/schemas.rb', line 22675

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

#to_json(options = nil) ⇒ Object



22681
22682
22683
# File 'lib/schemas.rb', line 22681

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