Class: PutApisAPIIDSchemasSchemaIDFilesFilePathResponse

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



28647
28648
28649
28650
28651
28652
28653
28654
28655
28656
28657
28658
# File 'lib/schemas.rb', line 28647

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at:                                                      d["createdAt"],
    created_by:                                                      d["createdBy"],
    id:                                                              d["id"],
    put_apis_api_id_schemas_schema_id_files_file_path_response_name: d["name"],
    path:                                                            d["path"],
    updated_at:                                                      d["updatedAt"],
    updated_by:                                                      d["updatedBy"],
  )
end

.from_json!(json) ⇒ Object



28660
28661
28662
# File 'lib/schemas.rb', line 28660

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

Instance Method Details

#to_dynamicObject



28664
28665
28666
28667
28668
28669
28670
28671
28672
28673
28674
# File 'lib/schemas.rb', line 28664

def to_dynamic
  {
    "createdAt" => created_at,
    "createdBy" => created_by,
    "id"        => id,
    "name"      => put_apis_api_id_schemas_schema_id_files_file_path_response_name,
    "path"      => path,
    "updatedAt" => updated_at,
    "updatedBy" => updated_by,
  }
end

#to_json(options = nil) ⇒ Object



28676
28677
28678
# File 'lib/schemas.rb', line 28676

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