Class: GetApisAPIIDCollectionsCollectionIDResponseItemItem

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



4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
# File 'lib/schemas.rb', line 4340

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    event:                                                             d["event"],
    id:                                                                d["id"],
    get_apis_api_id_collections_collection_id_response_item_item_name: d["name"],
    request:                                                           d["request"],
    response:                                                          d["response"],
  )
end

.from_json!(json) ⇒ Object



4351
4352
4353
# File 'lib/schemas.rb', line 4351

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

Instance Method Details

#to_dynamicObject



4355
4356
4357
4358
4359
4360
4361
4362
4363
# File 'lib/schemas.rb', line 4355

def to_dynamic
  {
    "event"    => event,
    "id"       => id,
    "name"     => get_apis_api_id_collections_collection_id_response_item_item_name,
    "request"  => request,
    "response" => response,
  }
end

#to_json(options = nil) ⇒ Object



4365
4366
4367
# File 'lib/schemas.rb', line 4365

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