Class: PutApisAPIIDVersionsVersionIDResponse

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



29247
29248
29249
29250
29251
29252
29253
29254
29255
29256
# File 'lib/schemas.rb', line 29247

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:                                        d["createdAt"],
    id:                                                d["id"],
    put_apis_api_id_versions_version_id_response_name: d["name"],
    release_notes:                                     d["releaseNotes"],
    updated_at:                                        d["updatedAt"],
  )
end

.from_json!(json) ⇒ Object



29258
29259
29260
# File 'lib/schemas.rb', line 29258

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

Instance Method Details

#to_dynamicObject



29262
29263
29264
29265
29266
29267
29268
29269
29270
# File 'lib/schemas.rb', line 29262

def to_dynamic
  {
    "createdAt"    => created_at,
    "id"           => id,
    "name"         => put_apis_api_id_versions_version_id_response_name,
    "releaseNotes" => release_notes,
    "updatedAt"    => updated_at,
  }
end

#to_json(options = nil) ⇒ Object



29272
29273
29274
# File 'lib/schemas.rb', line 29272

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