Class: GetCollectionsCollectionIDResponsesResponseIDResponse404

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



8535
8536
8537
8538
8539
8540
# File 'lib/schemas.rb', line 8535

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

.from_json!(json) ⇒ Object



8542
8543
8544
# File 'lib/schemas.rb', line 8542

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

Instance Method Details

#to_dynamicObject



8546
8547
8548
8549
8550
# File 'lib/schemas.rb', line 8546

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

#to_json(options = nil) ⇒ Object



8552
8553
8554
# File 'lib/schemas.rb', line 8552

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