Class: GetMonitorsMonitorIDResponseMonitorLastRunStats

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



12531
12532
12533
12534
12535
12536
12537
# File 'lib/schemas.rb', line 12531

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    assertions: d["assertions"] ? GetMonitorsMonitorIDResponseMonitorLastRunStatsAssertions.from_dynamic!(d["assertions"]) : nil,
    requests:   d["requests"] ? GetMonitorsMonitorIDResponseMonitorLastRunStatsRequests.from_dynamic!(d["requests"]) : nil,
  )
end

.from_json!(json) ⇒ Object



12539
12540
12541
# File 'lib/schemas.rb', line 12539

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

Instance Method Details

#to_dynamicObject



12543
12544
12545
12546
12547
12548
# File 'lib/schemas.rb', line 12543

def to_dynamic
  {
    "assertions" => assertions&.to_dynamic,
    "requests"   => requests&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



12550
12551
12552
# File 'lib/schemas.rb', line 12550

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