Class: PostCollectionsCollectionIDRequestsResponse401

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



21280
21281
21282
21283
21284
21285
# File 'lib/schemas.rb', line 21280

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

.from_json!(json) ⇒ Object



21287
21288
21289
# File 'lib/schemas.rb', line 21287

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

Instance Method Details

#to_dynamicObject



21291
21292
21293
21294
21295
# File 'lib/schemas.rb', line 21291

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

#to_json(options = nil) ⇒ Object



21297
21298
21299
# File 'lib/schemas.rb', line 21297

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