Class: GetCollectionsCollectionIDResponsesResponseIDResponse401

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



8436
8437
8438
8439
8440
8441
# File 'lib/schemas.rb', line 8436

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

.from_json!(json) ⇒ Object



8443
8444
8445
# File 'lib/schemas.rb', line 8443

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

Instance Method Details

#to_dynamicObject



8447
8448
8449
8450
8451
# File 'lib/schemas.rb', line 8447

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

#to_json(options = nil) ⇒ Object



8453
8454
8455
# File 'lib/schemas.rb', line 8453

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