Class: GetApisAPIIDVersionsVersionIDResponseVersionSchemasItem

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



6365
6366
6367
6368
6369
6370
6371
# File 'lib/schemas.rb', line 6365

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:                                                                     d["id"],
    get_apis_api_id_versions_version_id_response_version_schemas_item_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



6373
6374
6375
# File 'lib/schemas.rb', line 6373

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

Instance Method Details

#to_dynamicObject



6377
6378
6379
6380
6381
6382
# File 'lib/schemas.rb', line 6377

def to_dynamic
  {
    "id"   => id,
    "type" => get_apis_api_id_versions_version_id_response_version_schemas_item_type,
  }
end

#to_json(options = nil) ⇒ Object



6384
6385
6386
# File 'lib/schemas.rb', line 6384

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