Class: GetCollectionsCollectionIDFoldersFolderIDResponse401ErrorDetails

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



7393
7394
7395
7396
7397
7398
7399
7400
# File 'lib/schemas.rb', line 7393

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



7402
7403
7404
# File 'lib/schemas.rb', line 7402

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

Instance Method Details

#to_dynamicObject



7406
7407
7408
7409
7410
7411
7412
# File 'lib/schemas.rb', line 7406

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

#to_json(options = nil) ⇒ Object



7414
7415
7416
# File 'lib/schemas.rb', line 7414

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