Class: DeleteCollectionsCollectionIDResponsesResponseIDResponse401ErrorDetails

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



1692
1693
1694
1695
1696
1697
1698
1699
# File 'lib/schemas.rb', line 1692

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



1701
1702
1703
# File 'lib/schemas.rb', line 1701

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

Instance Method Details

#to_dynamicObject



1705
1706
1707
1708
1709
1710
1711
# File 'lib/schemas.rb', line 1705

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

#to_json(options = nil) ⇒ Object



1713
1714
1715
# File 'lib/schemas.rb', line 1713

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