Class: GetMocksMockIDServerResponsesServerResponseIDResponseItem

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



12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
# File 'lib/schemas.rb', line 12033

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

.from_json!(json) ⇒ Object



12046
12047
12048
# File 'lib/schemas.rb', line 12046

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

Instance Method Details

#to_dynamicObject



12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
# File 'lib/schemas.rb', line 12050

def to_dynamic
  {
    "createdAt"  => created_at,
    "createdBy"  => created_by,
    "id"         => id,
    "name"       => get_mocks_mock_id_server_responses_server_response_id_response_item_name,
    "statusCode" => status_code,
    "updatedAt"  => updated_at,
    "updatedBy"  => updated_by,
  }
end

#to_json(options = nil) ⇒ Object



12062
12063
12064
# File 'lib/schemas.rb', line 12062

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