Class: GetCollectionsCollectionIDRequestsRequestIDResponse401ErrorDetails

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



7724
7725
7726
7727
7728
7729
7730
7731
# File 'lib/schemas.rb', line 7724

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



7733
7734
7735
# File 'lib/schemas.rb', line 7733

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

Instance Method Details

#to_dynamicObject



7737
7738
7739
7740
7741
7742
7743
# File 'lib/schemas.rb', line 7737

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

#to_json(options = nil) ⇒ Object



7745
7746
7747
# File 'lib/schemas.rb', line 7745

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