Class: PutMonitorsMonitorIDBodyMonitor

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



33295
33296
33297
33298
33299
33300
33301
# File 'lib/schemas.rb', line 33295

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    put_monitors_monitor_id_body_monitor_name: d["name"],
    schedule:                                  d["schedule"] ? PutMonitorsMonitorIDBodyMonitorSchedule.from_dynamic!(d["schedule"]) : nil,
  )
end

.from_json!(json) ⇒ Object



33303
33304
33305
# File 'lib/schemas.rb', line 33303

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

Instance Method Details

#to_dynamicObject



33307
33308
33309
33310
33311
33312
# File 'lib/schemas.rb', line 33307

def to_dynamic
  {
    "name"     => put_monitors_monitor_id_body_monitor_name,
    "schedule" => schedule&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



33314
33315
33316
# File 'lib/schemas.rb', line 33314

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