Class: ContextDev::Models::MonitorCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/context_dev/models/monitor_create_params.rb,
sig/context_dev/models/monitor_create_params.rbs

Overview

See Also:

  • ContextDev::Resources::Monitors#create

Defined Under Namespace

Modules: ChangeDetection, Mode, Target Classes: Schedule, Webhook

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::ContextDev

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::MonitorCreateParams::Target::Extract for more details.

Watch a site's extracted structured data.

Parameters:

  • url (String)

    Root URL to extract structured data from.

  • follow_subdomains (Boolean) (defaults to: nil)
  • instructions (String) (defaults to: nil)

    Optional natural-language instructions guiding what to extract.

  • max_depth (Integer) (defaults to: nil)

    Optional maximum link depth from the starting URL (0 = only the starting page).

  • max_pages (Integer) (defaults to: nil)

    Maximum number of pages to analyze during extraction.

  • schema (Hash{Symbol=>Object}) (defaults to: nil)

    JSON Schema describing the structured data to extract and watch for changes. If

  • type (Symbol, :extract) (defaults to: :extract)


# File 'lib/context_dev/models/monitor_create_params.rb', line 53

Instance Attribute Details

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

Discriminated union describing how changes are detected.

Parameters:

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

Returns:



14
# File 'lib/context_dev/models/monitor_create_params.rb', line 14

required :change_detection, union: -> { ContextDev::MonitorCreateParams::ChangeDetection }

#modeSymbol, ...

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



40
# File 'lib/context_dev/models/monitor_create_params.rb', line 40

optional :mode, enum: -> { ContextDev::MonitorCreateParams::Mode }

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


19
# File 'lib/context_dev/models/monitor_create_params.rb', line 19

required :name, String

#scheduleContextDev::Models::MonitorCreateParams::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.

Parameters:

  • value (ContextDev::MonitorCreateParams::Schedule)

Returns:



27
# File 'lib/context_dev/models/monitor_create_params.rb', line 27

required :schedule, -> { ContextDev::MonitorCreateParams::Schedule }

#tagsArray<String>?

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

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


46
# File 'lib/context_dev/models/monitor_create_params.rb', line 46

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

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

Discriminated union describing what the monitor watches.



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

required :target, union: -> { ContextDev::MonitorCreateParams::Target }

#webhookContextDev::Models::MonitorCreateParams::Webhook?

Parameters:

  • value (ContextDev::MonitorCreateParams::Webhook, nil)

Returns:



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

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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/context_dev/models/monitor_create_params.rb', line 177

Instance Method Details

#to_hash{

Returns:

  • ({)


50
# File 'sig/context_dev/models/monitor_create_params.rbs', line 50

def to_hash: -> {