Class: GetMocksMockIDCallLogsResponseCallLogsItemRequest

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



10583
10584
10585
10586
10587
10588
10589
10590
10591
# File 'lib/schemas.rb', line 10583

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    body:                                                               d["body"] ? GetMocksMockIDCallLogsResponseCallLogsItemRequestBody.from_dynamic!(d["body"]) : nil,
    headers:                                                            d["headers"] ? GetMocksMockIDCallLogsResponseCallLogsItemRequestHeaders.from_dynamic!(d["headers"]) : nil,
    get_mocks_mock_id_call_logs_response_call_logs_item_request_method: d["method"],
    path:                                                               d["path"],
  )
end

.from_json!(json) ⇒ Object



10593
10594
10595
# File 'lib/schemas.rb', line 10593

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

Instance Method Details

#to_dynamicObject



10597
10598
10599
10600
10601
10602
10603
10604
# File 'lib/schemas.rb', line 10597

def to_dynamic
  {
    "body"    => body&.to_dynamic,
    "headers" => headers&.to_dynamic,
    "method"  => get_mocks_mock_id_call_logs_response_call_logs_item_request_method,
    "path"    => path,
  }
end

#to_json(options = nil) ⇒ Object



10606
10607
10608
# File 'lib/schemas.rb', line 10606

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