Class: GetCollectionsCollectionIDFoldersFolderIDResponse404ErrorDetails

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



7492
7493
7494
7495
7496
7497
7498
7499
# File 'lib/schemas.rb', line 7492

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



7501
7502
7503
# File 'lib/schemas.rb', line 7501

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

Instance Method Details

#to_dynamicObject



7505
7506
7507
7508
7509
7510
7511
# File 'lib/schemas.rb', line 7505

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

#to_json(options = nil) ⇒ Object



7513
7514
7515
# File 'lib/schemas.rb', line 7513

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