Class: PostMonitorsMonitorIDRunResponseRunInfo

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



25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
25277
25278
# File 'lib/schemas.rb', line 25266

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collection_uid:                                      d["collectionUid"],
    environment_uid:                                     d["environmentUid"],
    finished_at:                                         d["finishedAt"],
    job_id:                                              d["jobId"],
    monitor_id:                                          d["monitorId"],
    post_monitors_monitor_id_run_response_run_info_name: d["name"],
    started_at:                                          d["startedAt"],
    status:                                              d["status"],
  )
end

.from_json!(json) ⇒ Object



25280
25281
25282
# File 'lib/schemas.rb', line 25280

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

Instance Method Details

#to_dynamicObject



25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
# File 'lib/schemas.rb', line 25284

def to_dynamic
  {
    "collectionUid"  => collection_uid,
    "environmentUid" => environment_uid,
    "finishedAt"     => finished_at,
    "jobId"          => job_id,
    "monitorId"      => monitor_id,
    "name"           => post_monitors_monitor_id_run_response_run_info_name,
    "startedAt"      => started_at,
    "status"         => status,
  }
end

#to_json(options = nil) ⇒ Object



25297
25298
25299
# File 'lib/schemas.rb', line 25297

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