diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bfc26f9..75ec52f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.2.0" + ".": "2.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index c2cc39a..c1de7fe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-ecb277557634e2f0838ea196e2b21f11924f65e133c7977e8c2e1a603b8df466.yml -openapi_spec_hash: 798ce4cb042389a1179bf9af6fc1173d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d60fed3d26479d1ee76b77df8415390504542522e7188792a23bf77b9f37ed63.yml +openapi_spec_hash: 263672c59d9b01c50f7d2307fbd82ec0 config_hash: ff35e224e809656528c44163aa41bebd diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ef7ce..1dfd9c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 2.3.0 (2026-07-11) + +Full Changelog: [v2.2.0...v2.3.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.2.0...v2.3.0) + +### Features + +* **api:** api update ([28e740f](https://github.com/context-dot-dev/context-go-sdk/commit/28e740f468b39810f2f5ca477e67bbcab358ae11)) +* **api:** api update ([cea1ee4](https://github.com/context-dot-dev/context-go-sdk/commit/cea1ee4604ca3c5510d57f47afddc0c2f04a13bd)) + ## 2.2.0 (2026-07-10) Full Changelog: [v2.1.0...v2.2.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.1.0...v2.2.0) diff --git a/README.md b/README.md index b76c087..7d81aba 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Or to pin the version: ```sh -go get -u 'github.com/context-dot-dev/context-go-sdk@v2.2.0' +go get -u 'github.com/context-dot-dev/context-go-sdk@v2.3.0' ``` diff --git a/internal/version.go b/internal/version.go index 0759deb..ebb76be 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "2.2.0" // x-release-please-version +const PackageVersion = "2.3.0" // x-release-please-version diff --git a/monitor.go b/monitor.go index db6c705..d8e6bf2 100644 --- a/monitor.go +++ b/monitor.go @@ -209,6 +209,10 @@ type MonitorNewResponse struct { // User-defined tags for grouping and filtering monitors and their changes. Tags []string `json:"tags"` Webhook MonitorNewResponseWebhook `json:"webhook" api:"nullable"` + // Present while webhook deliveries are failing consecutively; null when deliveries + // are healthy or no webhook is configured. Cleared on the next successful delivery + // and when the webhook URL changes. + WebhookFailure MonitorNewResponseWebhookFailure `json:"webhook_failure" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field @@ -227,6 +231,7 @@ type MonitorNewResponse struct { NextRunAt respjson.Field Tags respjson.Field Webhook respjson.Field + WebhookFailure respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -759,6 +764,38 @@ func (r *MonitorNewResponseWebhook) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Present while webhook deliveries are failing consecutively; null when deliveries +// are healthy or no webhook is configured. Cleared on the next successful delivery +// and when the webhook URL changes. +type MonitorNewResponseWebhookFailure struct { + // Number of consecutive delivery attempts that did not succeed. + ConsecutiveFailures int64 `json:"consecutive_failures" api:"required"` + LastFailedAt time.Time `json:"last_failed_at" api:"required" format:"date-time"` + // Human-readable description of the most recent failure. + LastMessage string `json:"last_message" api:"required"` + // Outcome of the most recent failed delivery. rejected means a non-2xx response; + // failed means no HTTP response was received; skipped_unsafe_url means the URL + // failed the public-endpoint safety check. + // + // Any of "rejected", "failed", "skipped_unsafe_url". + LastStatus string `json:"last_status" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ConsecutiveFailures respjson.Field + LastFailedAt respjson.Field + LastMessage respjson.Field + LastStatus respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorNewResponseWebhookFailure) RawJSON() string { return r.JSON.raw } +func (r *MonitorNewResponseWebhookFailure) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // A web monitor. `mode` is the constant `web`; behavior is described by `target` // (page/sitemap/extract) and `change_detection` (exact/semantic). type MonitorGetResponse struct { @@ -801,6 +838,10 @@ type MonitorGetResponse struct { // User-defined tags for grouping and filtering monitors and their changes. Tags []string `json:"tags"` Webhook MonitorGetResponseWebhook `json:"webhook" api:"nullable"` + // Present while webhook deliveries are failing consecutively; null when deliveries + // are healthy or no webhook is configured. Cleared on the next successful delivery + // and when the webhook URL changes. + WebhookFailure MonitorGetResponseWebhookFailure `json:"webhook_failure" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field @@ -819,6 +860,7 @@ type MonitorGetResponse struct { NextRunAt respjson.Field Tags respjson.Field Webhook respjson.Field + WebhookFailure respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -1351,6 +1393,38 @@ func (r *MonitorGetResponseWebhook) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Present while webhook deliveries are failing consecutively; null when deliveries +// are healthy or no webhook is configured. Cleared on the next successful delivery +// and when the webhook URL changes. +type MonitorGetResponseWebhookFailure struct { + // Number of consecutive delivery attempts that did not succeed. + ConsecutiveFailures int64 `json:"consecutive_failures" api:"required"` + LastFailedAt time.Time `json:"last_failed_at" api:"required" format:"date-time"` + // Human-readable description of the most recent failure. + LastMessage string `json:"last_message" api:"required"` + // Outcome of the most recent failed delivery. rejected means a non-2xx response; + // failed means no HTTP response was received; skipped_unsafe_url means the URL + // failed the public-endpoint safety check. + // + // Any of "rejected", "failed", "skipped_unsafe_url". + LastStatus string `json:"last_status" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ConsecutiveFailures respjson.Field + LastFailedAt respjson.Field + LastMessage respjson.Field + LastStatus respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorGetResponseWebhookFailure) RawJSON() string { return r.JSON.raw } +func (r *MonitorGetResponseWebhookFailure) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // A web monitor. `mode` is the constant `web`; behavior is described by `target` // (page/sitemap/extract) and `change_detection` (exact/semantic). type MonitorUpdateResponse struct { @@ -1393,6 +1467,10 @@ type MonitorUpdateResponse struct { // User-defined tags for grouping and filtering monitors and their changes. Tags []string `json:"tags"` Webhook MonitorUpdateResponseWebhook `json:"webhook" api:"nullable"` + // Present while webhook deliveries are failing consecutively; null when deliveries + // are healthy or no webhook is configured. Cleared on the next successful delivery + // and when the webhook URL changes. + WebhookFailure MonitorUpdateResponseWebhookFailure `json:"webhook_failure" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field @@ -1411,6 +1489,7 @@ type MonitorUpdateResponse struct { NextRunAt respjson.Field Tags respjson.Field Webhook respjson.Field + WebhookFailure respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -1944,6 +2023,38 @@ func (r *MonitorUpdateResponseWebhook) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Present while webhook deliveries are failing consecutively; null when deliveries +// are healthy or no webhook is configured. Cleared on the next successful delivery +// and when the webhook URL changes. +type MonitorUpdateResponseWebhookFailure struct { + // Number of consecutive delivery attempts that did not succeed. + ConsecutiveFailures int64 `json:"consecutive_failures" api:"required"` + LastFailedAt time.Time `json:"last_failed_at" api:"required" format:"date-time"` + // Human-readable description of the most recent failure. + LastMessage string `json:"last_message" api:"required"` + // Outcome of the most recent failed delivery. rejected means a non-2xx response; + // failed means no HTTP response was received; skipped_unsafe_url means the URL + // failed the public-endpoint safety check. + // + // Any of "rejected", "failed", "skipped_unsafe_url". + LastStatus string `json:"last_status" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ConsecutiveFailures respjson.Field + LastFailedAt respjson.Field + LastMessage respjson.Field + LastStatus respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorUpdateResponseWebhookFailure) RawJSON() string { return r.JSON.raw } +func (r *MonitorUpdateResponseWebhookFailure) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type MonitorListResponse struct { Data []MonitorListResponseData `json:"data" api:"required"` HasMore bool `json:"has_more" api:"required"` @@ -2006,6 +2117,10 @@ type MonitorListResponseData struct { // User-defined tags for grouping and filtering monitors and their changes. Tags []string `json:"tags"` Webhook MonitorListResponseDataWebhook `json:"webhook" api:"nullable"` + // Present while webhook deliveries are failing consecutively; null when deliveries + // are healthy or no webhook is configured. Cleared on the next successful delivery + // and when the webhook URL changes. + WebhookFailure MonitorListResponseDataWebhookFailure `json:"webhook_failure" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field @@ -2024,6 +2139,7 @@ type MonitorListResponseData struct { NextRunAt respjson.Field Tags respjson.Field Webhook respjson.Field + WebhookFailure respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"` @@ -2538,6 +2654,38 @@ func (r *MonitorListResponseDataWebhook) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Present while webhook deliveries are failing consecutively; null when deliveries +// are healthy or no webhook is configured. Cleared on the next successful delivery +// and when the webhook URL changes. +type MonitorListResponseDataWebhookFailure struct { + // Number of consecutive delivery attempts that did not succeed. + ConsecutiveFailures int64 `json:"consecutive_failures" api:"required"` + LastFailedAt time.Time `json:"last_failed_at" api:"required" format:"date-time"` + // Human-readable description of the most recent failure. + LastMessage string `json:"last_message" api:"required"` + // Outcome of the most recent failed delivery. rejected means a non-2xx response; + // failed means no HTTP response was received; skipped_unsafe_url means the URL + // failed the public-endpoint safety check. + // + // Any of "rejected", "failed", "skipped_unsafe_url". + LastStatus string `json:"last_status" api:"required"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + ConsecutiveFailures respjson.Field + LastFailedAt respjson.Field + LastMessage respjson.Field + LastStatus respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r MonitorListResponseDataWebhookFailure) RawJSON() string { return r.JSON.raw } +func (r *MonitorListResponseDataWebhookFailure) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type MonitorDeleteResponse struct { ID string `json:"id" api:"required"` Deleted bool `json:"deleted" api:"required"` @@ -3020,7 +3168,7 @@ func (r *MonitorListRunsResponseDataWebhookDeliveryError) UnmarshalJSON(data []b // `change_detection_type` describe the change, and which optional fields are // present depends on them (page: `diff` + excerpts; sitemap: // `added_urls`/`removed_urls`; semantic: -// `query`/`confidence`/`importance`/`evidence`/`matched_urls`). +// `confidence`/`importance`/`evidence`/`matched_urls`). type MonitorGetChangeResponse struct { ID string `json:"id" api:"required"` // Any of "exact", "semantic". @@ -3035,6 +3183,8 @@ type MonitorGetChangeResponse struct { // The run that detected this change. RunID string `json:"run_id" api:"required"` Summary string `json:"summary" api:"required"` + // User-defined tags for grouping and filtering monitors and their changes. + Tags []string `json:"tags" api:"required"` // Any of "page", "sitemap", "extract". TargetType MonitorGetChangeResponseTargetType `json:"target_type" api:"required"` Title string `json:"title" api:"required"` @@ -3056,8 +3206,6 @@ type MonitorGetChangeResponse struct { RemovedURLCount int64 `json:"removed_url_count"` // At most 500 URLs are included; the corresponding count field is always exact. RemovedURLs []string `json:"removed_urls" format:"uri"` - // User-defined tags for grouping and filtering monitors and their changes. - Tags []string `json:"tags"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field @@ -3067,6 +3215,7 @@ type MonitorGetChangeResponse struct { MonitorID respjson.Field RunID respjson.Field Summary respjson.Field + Tags respjson.Field TargetType respjson.Field Title respjson.Field URL respjson.Field @@ -3082,7 +3231,6 @@ type MonitorGetChangeResponse struct { MatchedURLs respjson.Field RemovedURLCount respjson.Field RemovedURLs respjson.Field - Tags respjson.Field ExtraFields map[string]respjson.Field raw string } `json:"-"`