Class: GetMocksMockIDCallLogsResponseCallLogsItemResponse

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



10721
10722
10723
10724
10725
10726
10727
10728
10729
# File 'lib/schemas.rb', line 10721

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    body:                                                              d["body"] ? GetMocksMockIDCallLogsResponseCallLogsItemResponseBody.from_dynamic!(d["body"]) : nil,
    headers:                                                           d["headers"] ? GetMocksMockIDCallLogsResponseCallLogsItemResponseHeaders.from_dynamic!(d["headers"]) : nil,
    status_code:                                                       d["statusCode"],
    get_mocks_mock_id_call_logs_response_call_logs_item_response_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



10731
10732
10733
# File 'lib/schemas.rb', line 10731

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

Instance Method Details

#to_dynamicObject



10735
10736
10737
10738
10739
10740
10741
10742
# File 'lib/schemas.rb', line 10735

def to_dynamic
  {
    "body"       => body&.to_dynamic,
    "headers"    => headers&.to_dynamic,
    "statusCode" => status_code,
    "type"       => get_mocks_mock_id_call_logs_response_call_logs_item_response_type,
  }
end

#to_json(options = nil) ⇒ Object



10744
10745
10746
# File 'lib/schemas.rb', line 10744

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