Class: GetApisAPIIDSchemasSchemaIDFilesResponse

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



5103
5104
5105
5106
5107
5108
5109
# File 'lib/schemas.rb', line 5103

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    files:                                                 d["files"]&.map { |x| GetApisAPIIDSchemasSchemaIDFilesResponseFilesItem.from_dynamic!(x) },
    get_apis_api_id_schemas_schema_id_files_response_meta: d["meta"] ? GetApisAPIIDSchemasSchemaIDFilesResponseMeta.from_dynamic!(d["meta"]) : nil,
  )
end

.from_json!(json) ⇒ Object



5111
5112
5113
# File 'lib/schemas.rb', line 5111

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

Instance Method Details

#to_dynamicObject



5115
5116
5117
5118
5119
5120
# File 'lib/schemas.rb', line 5115

def to_dynamic
  {
    "files" => files&.map { |x| x.to_dynamic },
    "meta"  => get_apis_api_id_schemas_schema_id_files_response_meta&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



5122
5123
5124
# File 'lib/schemas.rb', line 5122

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