Class: PutCollectionsCollectionIDBodyCollectionInfo

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



29446
29447
29448
29449
29450
29451
29452
29453
# File 'lib/schemas.rb', line 29446

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    description:                                             d["description"],
    put_collections_collection_id_body_collection_info_name: d.fetch("name"),
    schema:                                                  d.fetch("schema"),
  )
end

.from_json!(json) ⇒ Object



29455
29456
29457
# File 'lib/schemas.rb', line 29455

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

Instance Method Details

#to_dynamicObject



29459
29460
29461
29462
29463
29464
29465
# File 'lib/schemas.rb', line 29459

def to_dynamic
  {
    "description" => description,
    "name"        => put_collections_collection_id_body_collection_info_name,
    "schema"      => schema,
  }
end

#to_json(options = nil) ⇒ Object



29467
29468
29469
# File 'lib/schemas.rb', line 29467

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