Class: GetApisResponseApisItem

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



6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
# File 'lib/schemas.rb', line 6617

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

.from_json!(json) ⇒ Object



6631
6632
6633
# File 'lib/schemas.rb', line 6631

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

Instance Method Details

#to_dynamicObject



6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
# File 'lib/schemas.rb', line 6635

def to_dynamic
  {
    "createdAt"   => created_at,
    "createdBy"   => created_by,
    "description" => description,
    "id"          => id,
    "name"        => get_apis_response_apis_item_name,
    "summary"     => summary,
    "updatedAt"   => updated_at,
    "updatedBy"   => updated_by,
  }
end

#to_json(options = nil) ⇒ Object



6648
6649
6650
# File 'lib/schemas.rb', line 6648

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