Class: GetCollectionsCollectionIDResponse401

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



8147
8148
8149
8150
8151
8152
# File 'lib/schemas.rb', line 8147

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

.from_json!(json) ⇒ Object



8154
8155
8156
# File 'lib/schemas.rb', line 8154

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

Instance Method Details

#to_dynamicObject



8158
8159
8160
8161
8162
# File 'lib/schemas.rb', line 8158

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

#to_json(options = nil) ⇒ Object



8164
8165
8166
# File 'lib/schemas.rb', line 8164

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