Class: GetCollectionsCollectionIDRequestsRequestIDResponse404ErrorDetails

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



7823
7824
7825
7826
7827
7828
7829
7830
# File 'lib/schemas.rb', line 7823

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



7832
7833
7834
# File 'lib/schemas.rb', line 7832

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

Instance Method Details

#to_dynamicObject



7836
7837
7838
7839
7840
7841
7842
# File 'lib/schemas.rb', line 7836

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

#to_json(options = nil) ⇒ Object



7844
7845
7846
# File 'lib/schemas.rb', line 7844

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