Class: PutCollectionsCollectionIDRequestsRequestIDResponse400ErrorDetails

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



30225
30226
30227
30228
30229
30230
30231
30232
# File 'lib/schemas.rb', line 30225

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



30234
30235
30236
# File 'lib/schemas.rb', line 30234

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

Instance Method Details

#to_dynamicObject



30238
30239
30240
30241
30242
30243
30244
# File 'lib/schemas.rb', line 30238

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

#to_json(options = nil) ⇒ Object



30246
30247
30248
# File 'lib/schemas.rb', line 30246

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