Class: PutCollectionsCollectionIDRequestsRequestIDResponse401ErrorDetails

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



30324
30325
30326
30327
30328
30329
30330
30331
# File 'lib/schemas.rb', line 30324

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



30333
30334
30335
# File 'lib/schemas.rb', line 30333

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

Instance Method Details

#to_dynamicObject



30337
30338
30339
30340
30341
30342
30343
# File 'lib/schemas.rb', line 30337

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

#to_json(options = nil) ⇒ Object



30345
30346
30347
# File 'lib/schemas.rb', line 30345

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