Class: PostCollectionsCollectionIDFoldersResponse401ErrorDetails

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



20834
20835
20836
20837
20838
20839
20840
20841
# File 'lib/schemas.rb', line 20834

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



20843
20844
20845
# File 'lib/schemas.rb', line 20843

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

Instance Method Details

#to_dynamicObject



20847
20848
20849
20850
20851
20852
20853
# File 'lib/schemas.rb', line 20847

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

#to_json(options = nil) ⇒ Object



20855
20856
20857
# File 'lib/schemas.rb', line 20855

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