Class: PutApisAPIIDSchemasSchemaIDFilesFilePathBody

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



28598
28599
28600
28601
28602
28603
28604
28605
# File 'lib/schemas.rb', line 28598

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    content:                                                     d.fetch("content"),
    put_apis_api_id_schemas_schema_id_files_file_path_body_name: d["name"],
    root:                                                        d["root"] ? PutApisAPIIDSchemasSchemaIDFilesFilePathBodyRoot.from_dynamic!(d["root"]) : nil,
  )
end

.from_json!(json) ⇒ Object



28607
28608
28609
# File 'lib/schemas.rb', line 28607

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

Instance Method Details

#to_dynamicObject



28611
28612
28613
28614
28615
28616
28617
# File 'lib/schemas.rb', line 28611

def to_dynamic
  {
    "content" => content,
    "name"    => put_apis_api_id_schemas_schema_id_files_file_path_body_name,
    "root"    => root&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



28619
28620
28621
# File 'lib/schemas.rb', line 28619

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