Class: PostMonitorsMonitorIDRunResponseRunExecutionsItemRequest

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



25124
25125
25126
25127
25128
25129
25130
25131
25132
25133
# File 'lib/schemas.rb', line 25124

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    body:                                                                     d["body"],
    headers:                                                                  d["headers"],
    post_monitors_monitor_id_run_response_run_executions_item_request_method: d["method"],
    timestamp:                                                                d["timestamp"],
    url:                                                                      d["url"],
  )
end

.from_json!(json) ⇒ Object



25135
25136
25137
# File 'lib/schemas.rb', line 25135

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

Instance Method Details

#to_dynamicObject



25139
25140
25141
25142
25143
25144
25145
25146
25147
# File 'lib/schemas.rb', line 25139

def to_dynamic
  {
    "body"      => body,
    "headers"   => headers,
    "method"    => post_monitors_monitor_id_run_response_run_executions_item_request_method,
    "timestamp" => timestamp,
    "url"       => url,
  }
end

#to_json(options = nil) ⇒ Object



25149
25150
25151
# File 'lib/schemas.rb', line 25149

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