Class: ContextDev::Models::MonitorListResponse::Data

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

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)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/context_dev/models/monitor_list_response.rb', line 27

class Data < ContextDev::Internal::Type::BaseModel
  # @!attribute id
  #
  #   @return [String]
  required :id, String

  # @!attribute change_detection
  #   Discriminated union describing how changes are detected.
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact, ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic]
  required :change_detection, union: -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection }

  # @!attribute created_at
  #
  #   @return [Time]
  required :created_at, Time

  # @!attribute mode
  #   Top-level monitor category. Always `web` today; the concrete behavior is
  #   described by `target` and `change_detection`.
  #
  #   @return [Symbol, ContextDev::Models::MonitorListResponse::Data::Mode]
  required :mode, enum: -> { ContextDev::Models::MonitorListResponse::Data::Mode }

  # @!attribute name
  #
  #   @return [String]
  required :name, String

  # @!attribute 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.
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::Schedule]
  required :schedule, -> { ContextDev::Models::MonitorListResponse::Data::Schedule }

  # @!attribute 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`.
  #
  #   @return [Symbol, ContextDev::Models::MonitorListResponse::Data::Status]
  required :status, enum: -> { ContextDev::Models::MonitorListResponse::Data::Status }

  # @!attribute target
  #   Discriminated union describing what the monitor watches.
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract]
  required :target, union: -> { ContextDev::Models::MonitorListResponse::Data::Target }

  # @!attribute updated_at
  #
  #   @return [Time]
  required :updated_at, Time

  # @!attribute baseline
  #   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).
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil]
  optional :baseline, union: -> { ContextDev::Models::MonitorListResponse::Data::Baseline }, nil?: true

  # @!attribute last_change_at
  #
  #   @return [Time, nil]
  optional :last_change_at, Time, nil?: true

  # @!attribute last_error
  #   Error from the most recent failed run; null when the last run succeeded.
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::LastError, nil]
  optional :last_error, -> { ContextDev::Models::MonitorListResponse::Data::LastError }, nil?: true

  # @!attribute last_run_at
  #
  #   @return [Time, nil]
  optional :last_run_at, Time, nil?: true

  # @!attribute next_run_at
  #   When the next scheduled run is due.
  #
  #   @return [Time, nil]
  optional :next_run_at, Time, nil?: true

  # @!attribute tags
  #   User-defined tags for grouping and filtering monitors and their changes.
  #
  #   @return [Array<String>, nil]
  optional :tags, ContextDev::Internal::Type::ArrayOf[String]

  # @!attribute webhook
  #
  #   @return [ContextDev::Models::MonitorListResponse::Data::Webhook, nil]
  optional :webhook, -> { ContextDev::Models::MonitorListResponse::Data::Webhook }, nil?: true

  # @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, baseline: nil, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil)
  #   Some parameter documentations has been truncated, see
  #   {ContextDev::Models::MonitorListResponse::Data} for more details.
  #
  #   A web monitor. `mode` is the constant `web`; behavior is described by `target`
  #   (page/sitemap/extract) and `change_detection` (exact/semantic).
  #
  #   @param id [String]
  #
  #   @param change_detection [ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact, ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
  #
  #   @param created_at [Time]
  #
  #   @param mode [Symbol, ContextDev::Models::MonitorListResponse::Data::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
  #
  #   @param name [String]
  #
  #   @param schedule [ContextDev::Models::MonitorListResponse::Data::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
  #
  #   @param status [Symbol, ContextDev::Models::MonitorListResponse::Data::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon
  #
  #   @param target [ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract] Discriminated union describing what the monitor watches.
  #
  #   @param updated_at [Time]
  #
  #   @param baseline [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
  #
  #   @param last_change_at [Time, nil]
  #
  #   @param last_error [ContextDev::Models::MonitorListResponse::Data::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
  #
  #   @param last_run_at [Time, nil]
  #
  #   @param next_run_at [Time, nil] When the next scheduled run is due.
  #
  #   @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
  #
  #   @param webhook [ContextDev::Models::MonitorListResponse::Data::Webhook, nil]

  # Discriminated union describing how changes are detected.
  #
  # @see ContextDev::Models::MonitorListResponse::Data#change_detection
  module ChangeDetection
    extend ContextDev::Internal::Type::Union

    discriminator :type

    # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
    variant :exact, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact }

    # Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
    variant :semantic, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic }

    class Exact < ContextDev::Internal::Type::BaseModel
      # @!attribute type
      #
      #   @return [Symbol, :exact]
      required :type, const: :exact

      # @!method initialize(type: :exact)
      #   Detect exact changes. For page targets, this means visible text diffs. For
      #   sitemap targets, this means URL additions and removals.
      #
      #   @param type [Symbol, :exact]
    end

    class Semantic < ContextDev::Internal::Type::BaseModel
      # @!attribute type
      #
      #   @return [Symbol, :semantic]
      required :type, const: :semantic

      # @!attribute confidence_threshold
      #
      #   @return [Float, nil]
      optional :confidence_threshold, Float

      # @!method initialize(confidence_threshold: nil, type: :semantic)
      #   Detect meaning-level changes to the extracted data, ignoring cosmetic or
      #   paraphrase-only differences. What is watched is determined by the extract
      #   target's `schema` and `instructions`.
      #
      #   @param confidence_threshold [Float]
      #   @param type [Symbol, :semantic]
    end

    # @!method self.variants
    #   @return [Array(ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact, ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic)]
  end

  # Top-level monitor category. Always `web` today; the concrete behavior is
  # described by `target` and `change_detection`.
  #
  # @see ContextDev::Models::MonitorListResponse::Data#mode
  module Mode
    extend ContextDev::Internal::Type::Enum

    WEB = :web

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # @see ContextDev::Models::MonitorListResponse::Data#schedule
  class Schedule < ContextDev::Internal::Type::BaseModel
    # @!attribute frequency
    #   Number of units between runs. The resulting interval (frequency × unit) must be
    #   at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
    #   maximum 365 when unit is days).
    #
    #   @return [Integer]
    required :frequency, Integer

    # @!attribute type
    #
    #   @return [Symbol, ContextDev::Models::MonitorListResponse::Data::Schedule::Type]
    required :type, enum: -> { ContextDev::Models::MonitorListResponse::Data::Schedule::Type }

    # @!attribute unit
    #
    #   @return [Symbol, ContextDev::Models::MonitorListResponse::Data::Schedule::Unit]
    required :unit, enum: -> { ContextDev::Models::MonitorListResponse::Data::Schedule::Unit }

    # @!method initialize(frequency:, type:, unit:)
    #   Some parameter documentations has been truncated, see
    #   {ContextDev::Models::MonitorListResponse::Data::Schedule} for more details.
    #
    #   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.
    #
    #   @param frequency [Integer] Number of units between runs. The resulting interval (frequency × unit) must be
    #
    #   @param type [Symbol, ContextDev::Models::MonitorListResponse::Data::Schedule::Type]
    #
    #   @param unit [Symbol, ContextDev::Models::MonitorListResponse::Data::Schedule::Unit]

    # @see ContextDev::Models::MonitorListResponse::Data::Schedule#type
    module Type
      extend ContextDev::Internal::Type::Enum

      INTERVAL = :interval

      # @!method self.values
      #   @return [Array<Symbol>]
    end

    # @see ContextDev::Models::MonitorListResponse::Data::Schedule#unit
    module Unit
      extend ContextDev::Internal::Type::Enum

      MINUTES = :minutes
      HOURS = :hours
      DAYS = :days

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

  # 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`.
  #
  # @see ContextDev::Models::MonitorListResponse::Data#status
  module Status
    extend ContextDev::Internal::Type::Enum

    ACTIVE = :active
    PAUSED = :paused
    FAILED = :failed

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # Discriminated union describing what the monitor watches.
  #
  # @see ContextDev::Models::MonitorListResponse::Data#target
  module Target
    extend ContextDev::Internal::Type::Union

    discriminator :type

    # Watch a single web page.
    variant :page, -> { ContextDev::Models::MonitorListResponse::Data::Target::Page }

    # Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.
    variant :sitemap, -> { ContextDev::Models::MonitorListResponse::Data::Target::Sitemap }

    # Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
    variant :extract, -> { ContextDev::Models::MonitorListResponse::Data::Target::Extract }

    class Page < ContextDev::Internal::Type::BaseModel
      # @!attribute type
      #
      #   @return [Symbol, :page]
      required :type, const: :page

      # @!attribute url
      #
      #   @return [String]
      required :url, String

      # @!attribute normalize_whitespace
      #   Normalize whitespace before comparing or analyzing text.
      #
      #   @return [Boolean, nil]
      optional :normalize_whitespace, ContextDev::Internal::Type::Boolean

      # @!method initialize(url:, normalize_whitespace: nil, type: :page)
      #   Watch a single web page.
      #
      #   @param url [String]
      #
      #   @param normalize_whitespace [Boolean] Normalize whitespace before comparing or analyzing text.
      #
      #   @param type [Symbol, :page]
    end

    class Sitemap < ContextDev::Internal::Type::BaseModel
      # @!attribute type
      #
      #   @return [Symbol, :sitemap]
      required :type, const: :sitemap

      # @!attribute url
      #   Sitemap URL to monitor.
      #
      #   @return [String]
      required :url, String

      # @!attribute exclude
      #   URL path patterns to exclude.
      #
      #   @return [Array<String>, nil]
      optional :exclude, ContextDev::Internal::Type::ArrayOf[String]

      # @!attribute include
      #   URL path patterns to include.
      #
      #   @return [Array<String>, nil]
      optional :include, ContextDev::Internal::Type::ArrayOf[String]

      # @!attribute max_urls
      #   Maximum number of sitemap URLs to track (capped at 10,000).
      #
      #   @return [Integer, nil]
      optional :max_urls, Integer

      # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
      #   Watch a sitemap for URL additions and removals. Crawled URLs are normalized
      #   (lowercased host, no trailing slash/fragment) and scoped to the monitored site
      #   and its subdomains before comparison. On a detected difference the sitemap is
      #   re-fetched within the same run and only URLs both observations agree on are
      #   reported, suppressing transient crawl flaps.
      #
      #   @param url [String] Sitemap URL to monitor.
      #
      #   @param exclude [Array<String>] URL path patterns to exclude.
      #
      #   @param include [Array<String>] URL path patterns to include.
      #
      #   @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
      #
      #   @param type [Symbol, :sitemap]
    end

    class Extract < ContextDev::Internal::Type::BaseModel
      # @!attribute instructions
      #   Natural-language instructions guiding which pages and facts to track and which
      #   changes to report.
      #
      #   @return [String]
      required :instructions, String

      # @!attribute type
      #
      #   @return [Symbol, :extract]
      required :type, const: :extract

      # @!attribute url
      #   Root URL to extract structured data from.
      #
      #   @return [String]
      required :url, String

      # @!attribute follow_subdomains
      #
      #   @return [Boolean, nil]
      optional :follow_subdomains, ContextDev::Internal::Type::Boolean

      # @!attribute max_depth
      #   Optional maximum link depth from the starting URL (0 = only the starting page).
      #
      #   @return [Integer, nil]
      optional :max_depth, Integer

      # @!attribute max_pages
      #   Maximum number of pages to track.
      #
      #   @return [Integer, nil]
      optional :max_pages, Integer

      # @!attribute schema
      #   JSON Schema describing the data you care about. It guides which pages are
      #   selected for tracking and gives the change judge context on what matters. If
      #   omitted, a default summary + key-points schema is used.
      #
      #   @return [Hash{Symbol=>Object}, nil]
      optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]

      # @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
      #   Some parameter documentations has been truncated, see
      #   {ContextDev::Models::MonitorListResponse::Data::Target::Extract} for more
      #   details.
      #
      #   Watch the monitor-relevant pages of a site for meaningful changes. A crawl
      #   guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
      #   track; each run re-checks exactly those pages, and confirmed content changes are
      #   judged against the monitor's instructions. The tracked page set is refreshed by
      #   a periodic re-discovery crawl.
      #
      #   @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
      #
      #   @param url [String] Root URL to extract structured data from.
      #
      #   @param follow_subdomains [Boolean]
      #
      #   @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
      #
      #   @param max_pages [Integer] Maximum number of pages to track.
      #
      #   @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
      #
      #   @param type [Symbol, :extract]
    end

    # @!method self.variants
    #   @return [Array(ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract)]
  end

  # 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).
  #
  # @see ContextDev::Models::MonitorListResponse::Data#baseline
  module Baseline
    extend ContextDev::Internal::Type::Union

    # Current baseline of a `page` monitor: the visible page text as last observed.
    variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline }

    # Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
    variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline }

    # Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
    variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline }

    class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
      # @!attribute captured_at
      #   When this baseline was last captured or replaced.
      #
      #   @return [Time]
      required :captured_at, Time

      # @!attribute text
      #   The page's visible text as last observed.
      #
      #   @return [String]
      required :text, String

      # @!method initialize(captured_at:, text:)
      #   Current baseline of a `page` monitor: the visible page text as last observed.
      #
      #   @param captured_at [Time] When this baseline was last captured or replaced.
      #
      #   @param text [String] The page's visible text as last observed.
    end

    class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
      # @!attribute captured_at
      #   When this baseline was last captured or replaced.
      #
      #   @return [Time]
      required :captured_at, Time

      # @!attribute url_count
      #   Number of URLs in the baseline.
      #
      #   @return [Integer]
      required :url_count, Integer

      # @!attribute urls
      #   The sitemap URLs as last observed (sorted, normalized).
      #
      #   @return [Array<String>]
      required :urls, ContextDev::Internal::Type::ArrayOf[String]

      # @!method initialize(captured_at:, url_count:, urls:)
      #   Current baseline of a `sitemap` monitor: the normalized URL set as last
      #   observed.
      #
      #   @param captured_at [Time] When this baseline was last captured or replaced.
      #
      #   @param url_count [Integer] Number of URLs in the baseline.
      #
      #   @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
    end

    class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
      # @!attribute captured_at
      #   When this baseline was last captured or replaced.
      #
      #   @return [Time]
      required :captured_at, Time

      # @!attribute data
      #   The extracted structured data, matching the monitor's extraction schema (same
      #   shape as the /web/extract endpoint's `data`). Refreshed when the monitor
      #   re-discovers its page set (at most about once a day); `null` when no extraction
      #   has been captured yet.
      #
      #   @return [Object]
      required :data, ContextDev::Internal::Type::Unknown

      # @!attribute urls_analyzed
      #   The page URLs the monitor tracks and analyzes for changes.
      #
      #   @return [Array<String>]
      required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]

      # @!method initialize(captured_at:, data:, urls_analyzed:)
      #   Some parameter documentations has been truncated, see
      #   {ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline}
      #   for more details.
      #
      #   Current baseline of an `extract` monitor: the pages it tracks and the structured
      #   data as last extracted.
      #
      #   @param captured_at [Time] When this baseline was last captured or replaced.
      #
      #   @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
      #
      #   @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
    end

    # @!method self.variants
    #   @return [Array(ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline)]
  end

  # @see ContextDev::Models::MonitorListResponse::Data#last_error
  class LastError < ContextDev::Internal::Type::BaseModel
    # @!attribute code
    #
    #   @return [String]
    required :code, String

    # @!attribute message
    #
    #   @return [String]
    required :message, String

    # @!method initialize(code:, message:)
    #   Error from the most recent failed run; null when the last run succeeded.
    #
    #   @param code [String]
    #   @param message [String]
  end

  # @see ContextDev::Models::MonitorListResponse::Data#webhook
  class Webhook < ContextDev::Internal::Type::BaseModel
    # @!attribute url
    #   Webhook URL called when a change is detected.
    #
    #   @return [String]
    required :url, String

    response_only do
      # @!attribute secret
      #   Signing secret used to verify webhook authenticity. Each delivery includes an
      #   `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
      #   `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
      #   compare and reject stale timestamps to prevent replay. Generated by the API;
      #   cannot be set by clients.
      #
      #   @return [String, nil]
      optional :secret, String
    end

    # @!method initialize(url:, secret: nil)
    #   Some parameter documentations has been truncated, see
    #   {ContextDev::Models::MonitorListResponse::Data::Webhook} for more details.
    #
    #   @param url [String] Webhook URL called when a change is detected.
    #
    #   @param secret [String] Signing secret used to verify webhook authenticity. Each delivery includes an `X
  end
end

Instance Attribute Details

#baselineContextDev::Models::MonitorListResponse::Data::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).



92
# File 'lib/context_dev/models/monitor_list_response.rb', line 92

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

#change_detectionContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact, ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic

Discriminated union describing how changes are detected.

Parameters:

  • value (ContextDev::Models::MonitorListResponse::Data::change_detection)

Returns:



37
# File 'lib/context_dev/models/monitor_list_response.rb', line 37

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

#created_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


42
# File 'lib/context_dev/models/monitor_list_response.rb', line 42

required :created_at, Time

#idString

Parameters:

  • value (String)

Returns:

  • (String)


31
# File 'lib/context_dev/models/monitor_list_response.rb', line 31

required :id, String

#last_change_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


97
# File 'lib/context_dev/models/monitor_list_response.rb', line 97

optional :last_change_at, Time, nil?: true

#last_errorContextDev::Models::MonitorListResponse::Data::LastError?

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



103
# File 'lib/context_dev/models/monitor_list_response.rb', line 103

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

#last_run_atTime?

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


108
# File 'lib/context_dev/models/monitor_list_response.rb', line 108

optional :last_run_at, Time, nil?: true

#modeSymbol, ContextDev::Models::MonitorListResponse::Data::Mode

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

Parameters:

  • value (ContextDev::Models::MonitorListResponse::Data::mode)

Returns:



49
# File 'lib/context_dev/models/monitor_list_response.rb', line 49

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

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


54
# File 'lib/context_dev/models/monitor_list_response.rb', line 54

required :name, String

#next_run_atTime?

When the next scheduled run is due.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


114
# File 'lib/context_dev/models/monitor_list_response.rb', line 114

optional :next_run_at, Time, nil?: true

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



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

required :schedule, -> { ContextDev::Models::MonitorListResponse::Data::Schedule }

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

Returns:



72
# File 'lib/context_dev/models/monitor_list_response.rb', line 72

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

#tagsArray<String>?

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

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


120
# File 'lib/context_dev/models/monitor_list_response.rb', line 120

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

#targetContextDev::Models::MonitorListResponse::Data::Target::Page, ...

Discriminated union describing what the monitor watches.



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

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

#updated_atTime

Parameters:

  • value (Time)

Returns:

  • (Time)


83
# File 'lib/context_dev/models/monitor_list_response.rb', line 83

required :updated_at, Time

#webhookContextDev::Models::MonitorListResponse::Data::Webhook?



125
# File 'lib/context_dev/models/monitor_list_response.rb', line 125

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

Instance Method Details

#to_hash{

Returns:

  • ({)


103
# File 'sig/context_dev/models/monitor_list_response.rbs', line 103

def to_hash: -> {