Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.2.0"
".": "2.3.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or to pin the version:
<!-- x-release-please-start-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'
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "2.2.0" // x-release-please-version
const PackageVersion = "2.3.0" // x-release-please-version
156 changes: 152 additions & 4 deletions monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:"-"`
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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:"-"`
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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:"-"`
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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
Expand All @@ -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:"-"`
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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".
Expand All @@ -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"`
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:"-"`
Expand Down
Loading