Class: GetApisAPIIDCollectionsCollectionIDResponseInfo

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



4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
# File 'lib/schemas.rb', line 4290

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    postman_id:                                                   d["_postman_id"],
    description:                                                  d["description"],
    get_apis_api_id_collections_collection_id_response_info_name: d["name"],
    schema:                                                       d["schema"],
    updated_at:                                                   d["updatedAt"],
  )
end

.from_json!(json) ⇒ Object



4301
4302
4303
# File 'lib/schemas.rb', line 4301

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

Instance Method Details

#to_dynamicObject



4305
4306
4307
4308
4309
4310
4311
4312
4313
# File 'lib/schemas.rb', line 4305

def to_dynamic
  {
    "_postman_id" => postman_id,
    "description" => description,
    "name"        => get_apis_api_id_collections_collection_id_response_info_name,
    "schema"      => schema,
    "updatedAt"   => updated_at,
  }
end

#to_json(options = nil) ⇒ Object



4315
4316
4317
# File 'lib/schemas.rb', line 4315

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