Class: GetApisAPIIDVersionsResponse

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



6143
6144
6145
6146
6147
6148
6149
# File 'lib/schemas.rb', line 6143

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    get_apis_api_id_versions_response_meta: d["meta"] ? GetApisAPIIDVersionsResponseMeta.from_dynamic!(d["meta"]) : nil,
    versions:                               d["versions"]&.map { |x| GetApisAPIIDVersionsResponseVersionsItem.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



6151
6152
6153
# File 'lib/schemas.rb', line 6151

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

Instance Method Details

#to_dynamicObject



6155
6156
6157
6158
6159
6160
# File 'lib/schemas.rb', line 6155

def to_dynamic
  {
    "meta"     => get_apis_api_id_versions_response_meta&.to_dynamic,
    "versions" => versions&.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



6162
6163
6164
# File 'lib/schemas.rb', line 6162

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