Class: PutMonitorsMonitorIDBodyMonitorSchedule

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



33263
33264
33265
33266
33267
33268
33269
# File 'lib/schemas.rb', line 33263

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    cron:     d["cron"],
    timezone: d["timezone"],
  )
end

.from_json!(json) ⇒ Object



33271
33272
33273
# File 'lib/schemas.rb', line 33271

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

Instance Method Details

#to_dynamicObject



33275
33276
33277
33278
33279
33280
# File 'lib/schemas.rb', line 33275

def to_dynamic
  {
    "cron"     => cron,
    "timezone" => timezone,
  }
end

#to_json(options = nil) ⇒ Object



33282
33283
33284
# File 'lib/schemas.rb', line 33282

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