Skip to content

Commit 9f486e7

Browse files
feat(api): api update
1 parent 94c1bb6 commit 9f486e7

5 files changed

Lines changed: 118 additions & 2 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-e3b1fd2a6aecb6cac87a0a2f4f811dedc261ae162cceced0841b5184ba609308.yml
3-
openapi_spec_hash: 28e4c0d0599e1f7153838a465f9cf5b5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d60fed3d26479d1ee76b77df8415390504542522e7188792a23bf77b9f37ed63.yml
3+
openapi_spec_hash: 263672c59d9b01c50f7d2307fbd82ec0
44
config_hash: ff35e224e809656528c44163aa41bebd

‎src/context/dev/types/monitor_create_response.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"BaselineMonitorsExtractBaseline",
2626
"LastError",
2727
"Webhook",
28+
"WebhookFailure",
2829
]
2930

3031

@@ -220,6 +221,27 @@ class Webhook(BaseModel):
220221
"""
221222

222223

224+
class WebhookFailure(BaseModel):
225+
"""
226+
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.
227+
"""
228+
229+
consecutive_failures: int
230+
"""Number of consecutive delivery attempts that did not succeed."""
231+
232+
last_failed_at: datetime
233+
234+
last_message: str
235+
"""Human-readable description of the most recent failure."""
236+
237+
last_status: Literal["rejected", "failed", "skipped_unsafe_url"]
238+
"""Outcome of the most recent failed delivery.
239+
240+
rejected means a non-2xx response; failed means no HTTP response was received;
241+
skipped_unsafe_url means the URL failed the public-endpoint safety check.
242+
"""
243+
244+
223245
class MonitorCreateResponse(BaseModel):
224246
"""A web monitor.
225247
@@ -285,3 +307,10 @@ class MonitorCreateResponse(BaseModel):
285307
"""User-defined tags for grouping and filtering monitors and their changes."""
286308

287309
webhook: Optional[Webhook] = None
310+
311+
webhook_failure: Optional[WebhookFailure] = None
312+
"""
313+
Present while webhook deliveries are failing consecutively; null when deliveries
314+
are healthy or no webhook is configured. Cleared on the next successful delivery
315+
and when the webhook URL changes.
316+
"""

‎src/context/dev/types/monitor_list_response.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"DataBaselineMonitorsExtractBaseline",
2727
"DataLastError",
2828
"DataWebhook",
29+
"DataWebhookFailure",
2930
]
3031

3132

@@ -221,6 +222,27 @@ class DataWebhook(BaseModel):
221222
"""
222223

223224

225+
class DataWebhookFailure(BaseModel):
226+
"""
227+
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.
228+
"""
229+
230+
consecutive_failures: int
231+
"""Number of consecutive delivery attempts that did not succeed."""
232+
233+
last_failed_at: datetime
234+
235+
last_message: str
236+
"""Human-readable description of the most recent failure."""
237+
238+
last_status: Literal["rejected", "failed", "skipped_unsafe_url"]
239+
"""Outcome of the most recent failed delivery.
240+
241+
rejected means a non-2xx response; failed means no HTTP response was received;
242+
skipped_unsafe_url means the URL failed the public-endpoint safety check.
243+
"""
244+
245+
224246
class Data(BaseModel):
225247
"""A web monitor.
226248
@@ -287,6 +309,13 @@ class Data(BaseModel):
287309

288310
webhook: Optional[DataWebhook] = None
289311

312+
webhook_failure: Optional[DataWebhookFailure] = None
313+
"""
314+
Present while webhook deliveries are failing consecutively; null when deliveries
315+
are healthy or no webhook is configured. Cleared on the next successful delivery
316+
and when the webhook URL changes.
317+
"""
318+
290319

291320
class MonitorListResponse(BaseModel):
292321
data: List[Data]

‎src/context/dev/types/monitor_retrieve_response.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"BaselineMonitorsExtractBaseline",
2626
"LastError",
2727
"Webhook",
28+
"WebhookFailure",
2829
]
2930

3031

@@ -220,6 +221,27 @@ class Webhook(BaseModel):
220221
"""
221222

222223

224+
class WebhookFailure(BaseModel):
225+
"""
226+
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.
227+
"""
228+
229+
consecutive_failures: int
230+
"""Number of consecutive delivery attempts that did not succeed."""
231+
232+
last_failed_at: datetime
233+
234+
last_message: str
235+
"""Human-readable description of the most recent failure."""
236+
237+
last_status: Literal["rejected", "failed", "skipped_unsafe_url"]
238+
"""Outcome of the most recent failed delivery.
239+
240+
rejected means a non-2xx response; failed means no HTTP response was received;
241+
skipped_unsafe_url means the URL failed the public-endpoint safety check.
242+
"""
243+
244+
223245
class MonitorRetrieveResponse(BaseModel):
224246
"""A web monitor.
225247
@@ -285,3 +307,10 @@ class MonitorRetrieveResponse(BaseModel):
285307
"""User-defined tags for grouping and filtering monitors and their changes."""
286308

287309
webhook: Optional[Webhook] = None
310+
311+
webhook_failure: Optional[WebhookFailure] = None
312+
"""
313+
Present while webhook deliveries are failing consecutively; null when deliveries
314+
are healthy or no webhook is configured. Cleared on the next successful delivery
315+
and when the webhook URL changes.
316+
"""

‎src/context/dev/types/monitor_update_response.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"BaselineMonitorsExtractBaseline",
2626
"LastError",
2727
"Webhook",
28+
"WebhookFailure",
2829
]
2930

3031

@@ -220,6 +221,27 @@ class Webhook(BaseModel):
220221
"""
221222

222223

224+
class WebhookFailure(BaseModel):
225+
"""
226+
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.
227+
"""
228+
229+
consecutive_failures: int
230+
"""Number of consecutive delivery attempts that did not succeed."""
231+
232+
last_failed_at: datetime
233+
234+
last_message: str
235+
"""Human-readable description of the most recent failure."""
236+
237+
last_status: Literal["rejected", "failed", "skipped_unsafe_url"]
238+
"""Outcome of the most recent failed delivery.
239+
240+
rejected means a non-2xx response; failed means no HTTP response was received;
241+
skipped_unsafe_url means the URL failed the public-endpoint safety check.
242+
"""
243+
244+
223245
class MonitorUpdateResponse(BaseModel):
224246
"""A web monitor.
225247
@@ -285,3 +307,10 @@ class MonitorUpdateResponse(BaseModel):
285307
"""User-defined tags for grouping and filtering monitors and their changes."""
286308

287309
webhook: Optional[Webhook] = None
310+
311+
webhook_failure: Optional[WebhookFailure] = None
312+
"""
313+
Present while webhook deliveries are failing consecutively; null when deliveries
314+
are healthy or no webhook is configured. Cleared on the next successful delivery
315+
and when the webhook URL changes.
316+
"""

0 commit comments

Comments
 (0)