Class: PatchCollectionsCollectionIDResponse

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



18015
18016
18017
18018
18019
18020
# File 'lib/schemas.rb', line 18015

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collection: d["collection"] ? PatchCollectionsCollectionIDResponseCollection.from_dynamic!(d["collection"]) : nil,
  )
end

.from_json!(json) ⇒ Object



18022
18023
18024
# File 'lib/schemas.rb', line 18022

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

Instance Method Details

#to_dynamicObject



18026
18027
18028
18029
18030
# File 'lib/schemas.rb', line 18026

def to_dynamic
  {
    "collection" => collection&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



18032
18033
18034
# File 'lib/schemas.rb', line 18032

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