Class: GetCollectionsResponse500

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



9200
9201
9202
9203
9204
9205
# File 'lib/schemas.rb', line 9200

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

.from_json!(json) ⇒ Object



9207
9208
9209
# File 'lib/schemas.rb', line 9207

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

Instance Method Details

#to_dynamicObject



9211
9212
9213
9214
9215
# File 'lib/schemas.rb', line 9211

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

#to_json(options = nil) ⇒ Object



9217
9218
9219
# File 'lib/schemas.rb', line 9217

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