Class: PostApisAPIIDSchemasResponseFilesItem

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



19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
# File 'lib/schemas.rb', line 19569

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

.from_json!(json) ⇒ Object



19582
19583
19584
# File 'lib/schemas.rb', line 19582

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

Instance Method Details

#to_dynamicObject



19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
# File 'lib/schemas.rb', line 19586

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

#to_json(options = nil) ⇒ Object



19598
19599
19600
# File 'lib/schemas.rb', line 19598

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