Class: GetCollectionsCollectionIDResponsesResponseIDResponse401ErrorDetails

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



8370
8371
8372
8373
8374
8375
8376
8377
# File 'lib/schemas.rb', line 8370

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    model:    d["model"],
    model_id: d["model_id"],
    owner:    d["owner"],
  )
end

.from_json!(json) ⇒ Object



8379
8380
8381
# File 'lib/schemas.rb', line 8379

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

Instance Method Details

#to_dynamicObject



8383
8384
8385
8386
8387
8388
8389
# File 'lib/schemas.rb', line 8383

def to_dynamic
  {
    "model"    => model,
    "model_id" => model_id,
    "owner"    => owner,
  }
end

#to_json(options = nil) ⇒ Object



8391
8392
8393
# File 'lib/schemas.rb', line 8391

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