Class: PutCollectionsCollectionIDRequestsRequestIDResponse404ErrorDetails

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



30423
30424
30425
30426
30427
30428
30429
30430
# File 'lib/schemas.rb', line 30423

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



30432
30433
30434
# File 'lib/schemas.rb', line 30432

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

Instance Method Details

#to_dynamicObject



30436
30437
30438
30439
30440
30441
30442
# File 'lib/schemas.rb', line 30436

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

#to_json(options = nil) ⇒ Object



30444
30445
30446
# File 'lib/schemas.rb', line 30444

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