Class: ContextDev::Models::MonitorCreateResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/monitor_create_response.rb,
sig/context_dev/models/monitor_create_response.rbs

Overview

See Also:

  • ContextDev::Resources::Monitors#create

Defined Under Namespace

Modules: Baseline, ChangeDetection, Mode, Status, Target Classes: LastError, Schedule, Webhook

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(code:, message:) ⇒ Object

Error from the most recent failed run; null when the last run succeeded.

Parameters:

  • code (String)
  • message (String)


# File 'lib/context_dev/models/monitor_create_response.rb', line 106

Instance Attribute Details

#baselineContextDev::Models::MonitorCreateResponse::Baseline::MonitorsPageBaseline, ...

Current baseline: the last observed value the monitor compares new snapshots against. Its shape follows target.type (page/sitemap/extract). Only populated on GET /monitors/monitor_id; null until the first baseline run completes (and after a target or change_detection update, which resets the baseline).



71
# File 'lib/context_dev/models/monitor_create_response.rb', line 71

optional :baseline, union: -> { ContextDev::Models::MonitorCreateResponse::Baseline }, nil?: true

#change_detectionContextDev::Models::MonitorCreateResponse::ChangeDetection::Exact, ContextDev::Models::MonitorCreateResponse::ChangeDetection::Semantic

Discriminated union describing how changes are detected.

Parameters:

  • value (ContextDev::Models::MonitorCreateResponse::change_detection)

Returns:



16
# File 'lib/context_dev/models/monitor_create_response.rb', line 16

required :change_detection, union: -> { ContextDev::Models::MonitorCreateResponse::ChangeDetection }

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


21
# File 'lib/context_dev/models/monitor_create_response.rb', line 21

required :created_at, Time

#idString

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/context_dev/models/monitor_create_response.rb', line 10

required :id, String

#last_change_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


76
# File 'lib/context_dev/models/monitor_create_response.rb', line 76

optional :last_change_at, Time, nil?: true

#last_errorContextDev::Models::MonitorCreateResponse::LastError?

Error from the most recent failed run; null when the last run succeeded.



82
# File 'lib/context_dev/models/monitor_create_response.rb', line 82

optional :last_error, -> { ContextDev::Models::MonitorCreateResponse::LastError }, nil?: true

#last_run_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


87
# File 'lib/context_dev/models/monitor_create_response.rb', line 87

optional :last_run_at, Time, nil?: true

#modeSymbol, ContextDev::Models::MonitorCreateResponse::Mode

Top-level monitor category. Always web today; the concrete behavior is described by target and change_detection.

Parameters:

  • value (ContextDev::Models::MonitorCreateResponse::mode)

Returns:



28
# File 'lib/context_dev/models/monitor_create_response.rb', line 28

required :mode, enum: -> { ContextDev::Models::MonitorCreateResponse::Mode }

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


33
# File 'lib/context_dev/models/monitor_create_response.rb', line 33

required :name, String

#next_run_atTime?

When the next scheduled run is due.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


93
# File 'lib/context_dev/models/monitor_create_response.rb', line 93

optional :next_run_at, Time, nil?: true

#scheduleContextDev::Models::MonitorCreateResponse::Schedule

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.



41
# File 'lib/context_dev/models/monitor_create_response.rb', line 41

required :schedule, -> { ContextDev::Models::MonitorCreateResponse::Schedule }

#statusSymbol, ContextDev::Models::MonitorCreateResponse::Status

Monitor lifecycle status. failed means the most recent run failed (see the monitor's last_error); failed monitors keep running on schedule and flip back to active on the next successful run. Monitors are auto-paused after repeated consecutive failures or insufficient-credit skips; resume by PATCHing status to active.

Parameters:

  • value (ContextDev::Models::MonitorCreateResponse::status)

Returns:



51
# File 'lib/context_dev/models/monitor_create_response.rb', line 51

required :status, enum: -> { ContextDev::Models::MonitorCreateResponse::Status }

#tagsArray<String>?

User-defined tags for grouping and filtering monitors and their changes.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


99
# File 'lib/context_dev/models/monitor_create_response.rb', line 99

optional :tags, ContextDev::Internal::Type::ArrayOf[String]

#targetContextDev::Models::MonitorCreateResponse::Target::Page, ...

Discriminated union describing what the monitor watches.



57
# File 'lib/context_dev/models/monitor_create_response.rb', line 57

required :target, union: -> { ContextDev::Models::MonitorCreateResponse::Target }

#updated_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


62
# File 'lib/context_dev/models/monitor_create_response.rb', line 62

required :updated_at, Time

#webhookContextDev::Models::MonitorCreateResponse::Webhook?



104
# File 'lib/context_dev/models/monitor_create_response.rb', line 104

optional :webhook, -> { ContextDev::Models::MonitorCreateResponse::Webhook }, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


77
# File 'sig/context_dev/models/monitor_create_response.rbs', line 77

def to_hash: -> {