Class: ContextDev::Models::MonitorUpdateResponse

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

Overview

See Also:

  • ContextDev::Resources::Monitors#update

Defined Under Namespace

Modules: 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_update_response.rb', line 97

Instance Attribute Details

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

Discriminated union describing how changes are detected.

Parameters:

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

Returns:



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

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

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#idString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#last_change_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


67
# File 'lib/context_dev/models/monitor_update_response.rb', line 67

optional :last_change_at, Time, nil?: true

#last_errorContextDev::Models::MonitorUpdateResponse::LastError?

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



73
# File 'lib/context_dev/models/monitor_update_response.rb', line 73

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

#last_run_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


78
# File 'lib/context_dev/models/monitor_update_response.rb', line 78

optional :last_run_at, Time, nil?: true

#modeSymbol, ContextDev::Models::MonitorUpdateResponse::Mode

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

Parameters:

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

Returns:



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

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

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


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

required :name, String

#next_run_atTime?

When the next scheduled run is due.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


84
# File 'lib/context_dev/models/monitor_update_response.rb', line 84

optional :next_run_at, Time, nil?: true

#scheduleContextDev::Models::MonitorUpdateResponse::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_update_response.rb', line 41

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

#statusSymbol, ContextDev::Models::MonitorUpdateResponse::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::MonitorUpdateResponse::status)

Returns:



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

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

#tagsArray<String>?

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

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


90
# File 'lib/context_dev/models/monitor_update_response.rb', line 90

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

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

Discriminated union describing what the monitor watches.



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

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

#updated_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :updated_at, Time

#webhookContextDev::Models::MonitorUpdateResponse::Webhook?



95
# File 'lib/context_dev/models/monitor_update_response.rb', line 95

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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/monitor_update_response.rb', line 198

Instance Method Details

#to_hash{

Returns:

  • ({)


73
# File 'sig/context_dev/models/monitor_update_response.rbs', line 73

def to_hash: -> {