mirror of
https://github.com/cloudflare/cloudflare-python.git
synced 2026-01-16 23:01:03 +00:00
feat(api): update via SDK Studio (#646)
This commit is contained in:
parent
882d30d1f7
commit
a0ab776c16
28 changed files with 387 additions and 933 deletions
|
|
@ -1,2 +1,2 @@
|
|||
configured_endpoints: 1296
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b52b16bff8ec1d2a907464ad0923ecf4dcb16c4d7c4e36396aeb24fd2cea99a.yml
|
||||
configured_endpoints: 1294
|
||||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eaf3cf93b4b0566484405b918a65aeca6e5ad4cc194989298a633601684fa0c1.yml
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
### With Rye
|
||||
|
||||
We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
|
||||
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
|
||||
|
||||
After installing Rye, you'll just have to run this command:
|
||||
|
||||
|
|
|
|||
31
api.md
31
api.md
|
|
@ -4483,12 +4483,6 @@ Methods:
|
|||
|
||||
# Alerting
|
||||
|
||||
Types:
|
||||
|
||||
```python
|
||||
from cloudflare.types.alerting import Alert
|
||||
```
|
||||
|
||||
## AvailableAlerts
|
||||
|
||||
Types:
|
||||
|
|
@ -4531,10 +4525,10 @@ from cloudflare.types.alerting.destinations import (
|
|||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/destinations/pagerduty/connect">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">create</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_create_response.py">PagerdutyCreateResponse</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/pagerduty">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">delete</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py">Optional</a></code>
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/destinations/pagerduty/connect">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">create</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_create_response.py">Optional</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/pagerduty">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">delete</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_delete_response.py">PagerdutyDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/pagerduty">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">get</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_get_response.py">Optional</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">link</a>(token_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_link_response.py">PagerdutyLinkResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/pagerduty/connect/{token_id}">client.alerting.destinations.pagerduty.<a href="./src/cloudflare/resources/alerting/destinations/pagerduty.py">link</a>(token_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/pagerduty_link_response.py">Optional</a></code>
|
||||
|
||||
### Webhooks
|
||||
|
||||
|
|
@ -4551,11 +4545,11 @@ from cloudflare.types.alerting.destinations import (
|
|||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/destinations/webhook_create_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_create_response.py">WebhookCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">update</a>(webhook_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/destinations/webhook_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_update_response.py">WebhookUpdateResponse</a></code>
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/destinations/webhook_create_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_create_response.py">Optional</a></code>
|
||||
- <code title="put /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">update</a>(webhook_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/destinations/webhook_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_update_response.py">Optional</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/webhooks.py">SyncSinglePage[Webhooks]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">delete</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_delete_response.py">Optional</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">get</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/webhooks.py">Webhooks</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">delete</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/webhook_delete_response.py">WebhookDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}">client.alerting.destinations.webhooks.<a href="./src/cloudflare/resources/alerting/destinations/webhooks.py">get</a>(webhook_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/destinations/webhooks.py">Optional</a></code>
|
||||
|
||||
## History
|
||||
|
||||
|
|
@ -4586,11 +4580,11 @@ from cloudflare.types.alerting import (
|
|||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/policies">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/policy_create_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/policy_create_response.py">PolicyCreateResponse</a></code>
|
||||
- <code title="put /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">update</a>(policy_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/policy_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/policy_update_response.py">PolicyUpdateResponse</a></code>
|
||||
- <code title="post /accounts/{account_id}/alerting/v3/policies">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/alerting/policy_create_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/policy_create_response.py">Optional</a></code>
|
||||
- <code title="put /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">update</a>(policy_id, \*, account_id, \*\*<a href="src/cloudflare/types/alerting/policy_update_params.py">params</a>) -> <a href="./src/cloudflare/types/alerting/policy_update_response.py">Optional</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/policies">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/alerting/policy.py">SyncSinglePage[Policy]</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">delete</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/policy_delete_response.py">Optional</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">get</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/policy.py">Policy</a></code>
|
||||
- <code title="delete /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">delete</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/policy_delete_response.py">PolicyDeleteResponse</a></code>
|
||||
- <code title="get /accounts/{account_id}/alerting/v3/policies/{policy_id}">client.alerting.policies.<a href="./src/cloudflare/resources/alerting/policies.py">get</a>(policy_id, \*, account_id) -> <a href="./src/cloudflare/types/alerting/policy.py">Optional</a></code>
|
||||
|
||||
# D1
|
||||
|
||||
|
|
@ -5183,7 +5177,6 @@ from cloudflare.types.zero_trust.access.applications import (
|
|||
Policy,
|
||||
PolicyCreateResponse,
|
||||
PolicyUpdateResponse,
|
||||
PolicyListResponse,
|
||||
PolicyDeleteResponse,
|
||||
PolicyGetResponse,
|
||||
)
|
||||
|
|
@ -5193,7 +5186,6 @@ Methods:
|
|||
|
||||
- <code title="post /{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies">client.zero_trust.access.applications.policies.<a href="./src/cloudflare/resources/zero_trust/access/applications/policies.py">create</a>(uuid, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/applications/policy_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/applications/policy_create_response.py">Optional</a></code>
|
||||
- <code title="put /{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}">client.zero_trust.access.applications.policies.<a href="./src/cloudflare/resources/zero_trust/access/applications/policies.py">update</a>(uuid, \*, uuid1, account_id, zone_id, \*\*<a href="src/cloudflare/types/zero_trust/access/applications/policy_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/applications/policy_update_response.py">Optional</a></code>
|
||||
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies">client.zero_trust.access.applications.policies.<a href="./src/cloudflare/resources/zero_trust/access/applications/policies.py">list</a>(uuid, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/policy_list_response.py">SyncSinglePage[PolicyListResponse]</a></code>
|
||||
- <code title="delete /{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}">client.zero_trust.access.applications.policies.<a href="./src/cloudflare/resources/zero_trust/access/applications/policies.py">delete</a>(uuid, \*, uuid1, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/policy_delete_response.py">Optional</a></code>
|
||||
- <code title="get /{account_or_zone}/{account_or_zone_id}/access/apps/{uuid1}/policies/{uuid}">client.zero_trust.access.applications.policies.<a href="./src/cloudflare/resources/zero_trust/access/applications/policies.py">get</a>(uuid, \*, uuid1, account_id, zone_id) -> <a href="./src/cloudflare/types/zero_trust/access/applications/policy_get_response.py">Optional</a></code>
|
||||
|
||||
|
|
@ -5382,7 +5374,6 @@ from cloudflare.types.zero_trust.access import (
|
|||
|
||||
Methods:
|
||||
|
||||
- <code title="post /accounts/{identifier}/access/custom_pages">client.zero_trust.access.custom_pages.<a href="./src/cloudflare/resources/zero_trust/access/custom_pages.py">create</a>(identifier, \*\*<a href="src/cloudflare/types/zero_trust/access/custom_page_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/custom_page_without_html.py">Optional</a></code>
|
||||
- <code title="put /accounts/{identifier}/access/custom_pages/{uuid}">client.zero_trust.access.custom_pages.<a href="./src/cloudflare/resources/zero_trust/access/custom_pages.py">update</a>(uuid, \*, identifier, \*\*<a href="src/cloudflare/types/zero_trust/access/custom_page_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/access/custom_page_without_html.py">Optional</a></code>
|
||||
- <code title="get /accounts/{identifier}/access/custom_pages">client.zero_trust.access.custom_pages.<a href="./src/cloudflare/resources/zero_trust/access/custom_pages.py">list</a>(identifier) -> <a href="./src/cloudflare/types/zero_trust/access/custom_page_without_html.py">SyncSinglePage[CustomPageWithoutHTML]</a></code>
|
||||
- <code title="delete /accounts/{identifier}/access/custom_pages/{uuid}">client.zero_trust.access.custom_pages.<a href="./src/cloudflare/resources/zero_trust/access/custom_pages.py">delete</a>(uuid, \*, identifier) -> <a href="./src/cloudflare/types/zero_trust/access/custom_page_delete_response.py">Optional</a></code>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -60,21 +60,16 @@ class AvailableAlertsResource(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[AvailableAlertListResponse],
|
||||
self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/available_alerts",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AvailableAlertListResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AvailableAlertListResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/available_alerts",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AvailableAlertListResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AvailableAlertListResponse]], ResultWrapper[AvailableAlertListResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -114,21 +109,16 @@ class AsyncAvailableAlertsResource(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[AvailableAlertListResponse],
|
||||
await self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/available_alerts",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AvailableAlertListResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[AvailableAlertListResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/available_alerts",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[AvailableAlertListResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[AvailableAlertListResponse]], ResultWrapper[AvailableAlertListResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -60,21 +60,16 @@ class EligibleResource(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[EligibleGetResponse],
|
||||
self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/eligible",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EligibleGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[EligibleGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/eligible",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EligibleGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EligibleGetResponse]], ResultWrapper[EligibleGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -114,21 +109,16 @@ class AsyncEligibleResource(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[EligibleGetResponse],
|
||||
await self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/eligible",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EligibleGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[EligibleGetResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._get(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/eligible",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[EligibleGetResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[EligibleGetResponse]], ResultWrapper[EligibleGetResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class PagerdutyResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PagerdutyCreateResponse:
|
||||
) -> Optional[PagerdutyCreateResponse]:
|
||||
"""
|
||||
Creates a new token for integrating with PagerDuty.
|
||||
|
||||
|
|
@ -70,9 +70,9 @@ class PagerdutyResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PagerdutyCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PagerdutyCreateResponse], ResultWrapper[PagerdutyCreateResponse]),
|
||||
cast_to=cast(Type[Optional[PagerdutyCreateResponse]], ResultWrapper[PagerdutyCreateResponse]),
|
||||
)
|
||||
|
||||
def delete(
|
||||
|
|
@ -85,7 +85,7 @@ class PagerdutyResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PagerdutyDeleteResponse]:
|
||||
) -> PagerdutyDeleteResponse:
|
||||
"""
|
||||
Deletes all the PagerDuty Services connected to the account.
|
||||
|
||||
|
|
@ -102,21 +102,12 @@ class PagerdutyResource(SyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[PagerdutyDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PagerdutyDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PagerdutyDeleteResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -169,7 +160,7 @@ class PagerdutyResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PagerdutyLinkResponse:
|
||||
) -> Optional[PagerdutyLinkResponse]:
|
||||
"""
|
||||
Links PagerDuty with the account using the integration token.
|
||||
|
||||
|
|
@ -197,9 +188,9 @@ class PagerdutyResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PagerdutyLinkResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyLinkResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PagerdutyLinkResponse], ResultWrapper[PagerdutyLinkResponse]),
|
||||
cast_to=cast(Type[Optional[PagerdutyLinkResponse]], ResultWrapper[PagerdutyLinkResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -222,7 +213,7 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PagerdutyCreateResponse:
|
||||
) -> Optional[PagerdutyCreateResponse]:
|
||||
"""
|
||||
Creates a new token for integrating with PagerDuty.
|
||||
|
||||
|
|
@ -246,9 +237,9 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PagerdutyCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PagerdutyCreateResponse], ResultWrapper[PagerdutyCreateResponse]),
|
||||
cast_to=cast(Type[Optional[PagerdutyCreateResponse]], ResultWrapper[PagerdutyCreateResponse]),
|
||||
)
|
||||
|
||||
async def delete(
|
||||
|
|
@ -261,7 +252,7 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PagerdutyDeleteResponse]:
|
||||
) -> PagerdutyDeleteResponse:
|
||||
"""
|
||||
Deletes all the PagerDuty Services connected to the account.
|
||||
|
||||
|
|
@ -278,21 +269,12 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
"""
|
||||
if not account_id:
|
||||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
return cast(
|
||||
Optional[PagerdutyDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PagerdutyDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/pagerduty",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PagerdutyDeleteResponse,
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -345,7 +327,7 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PagerdutyLinkResponse:
|
||||
) -> Optional[PagerdutyLinkResponse]:
|
||||
"""
|
||||
Links PagerDuty with the account using the integration token.
|
||||
|
||||
|
|
@ -373,9 +355,9 @@ class AsyncPagerdutyResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PagerdutyLinkResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PagerdutyLinkResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PagerdutyLinkResponse], ResultWrapper[PagerdutyLinkResponse]),
|
||||
cast_to=cast(Type[Optional[PagerdutyLinkResponse]], ResultWrapper[PagerdutyLinkResponse]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
|
||||
import httpx
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WebhookCreateResponse:
|
||||
) -> Optional[WebhookCreateResponse]:
|
||||
"""
|
||||
Creates a new webhook destination.
|
||||
|
||||
|
|
@ -97,9 +97,9 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[WebhookCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[WebhookCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WebhookCreateResponse], ResultWrapper[WebhookCreateResponse]),
|
||||
cast_to=cast(Type[Optional[WebhookCreateResponse]], ResultWrapper[WebhookCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
|
|
@ -116,7 +116,7 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WebhookUpdateResponse:
|
||||
) -> Optional[WebhookUpdateResponse]:
|
||||
"""
|
||||
Update a webhook destination.
|
||||
|
||||
|
|
@ -161,9 +161,9 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[WebhookUpdateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[WebhookUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WebhookUpdateResponse], ResultWrapper[WebhookUpdateResponse]),
|
||||
cast_to=cast(Type[Optional[WebhookUpdateResponse]], ResultWrapper[WebhookUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -213,7 +213,7 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebhookDeleteResponse]:
|
||||
) -> WebhookDeleteResponse:
|
||||
"""
|
||||
Delete a configured webhook destination.
|
||||
|
||||
|
|
@ -234,21 +234,12 @@ class WebhooksResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not webhook_id:
|
||||
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
|
||||
return cast(
|
||||
Optional[WebhookDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebhookDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[WebhookDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=WebhookDeleteResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -262,7 +253,7 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Webhooks:
|
||||
) -> Optional[Webhooks]:
|
||||
"""
|
||||
Get details for a single webhooks destination.
|
||||
|
||||
|
|
@ -290,9 +281,9 @@ class WebhooksResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Webhooks]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Webhooks]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Webhooks], ResultWrapper[Webhooks]),
|
||||
cast_to=cast(Type[Optional[Webhooks]], ResultWrapper[Webhooks]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -318,7 +309,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WebhookCreateResponse:
|
||||
) -> Optional[WebhookCreateResponse]:
|
||||
"""
|
||||
Creates a new webhook destination.
|
||||
|
||||
|
|
@ -359,9 +350,9 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[WebhookCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[WebhookCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WebhookCreateResponse], ResultWrapper[WebhookCreateResponse]),
|
||||
cast_to=cast(Type[Optional[WebhookCreateResponse]], ResultWrapper[WebhookCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
|
|
@ -378,7 +369,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> WebhookUpdateResponse:
|
||||
) -> Optional[WebhookUpdateResponse]:
|
||||
"""
|
||||
Update a webhook destination.
|
||||
|
||||
|
|
@ -423,9 +414,9 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[WebhookUpdateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[WebhookUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[WebhookUpdateResponse], ResultWrapper[WebhookUpdateResponse]),
|
||||
cast_to=cast(Type[Optional[WebhookUpdateResponse]], ResultWrapper[WebhookUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -475,7 +466,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[WebhookDeleteResponse]:
|
||||
) -> WebhookDeleteResponse:
|
||||
"""
|
||||
Delete a configured webhook destination.
|
||||
|
||||
|
|
@ -496,21 +487,12 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not webhook_id:
|
||||
raise ValueError(f"Expected a non-empty value for `webhook_id` but received {webhook_id!r}")
|
||||
return cast(
|
||||
Optional[WebhookDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[WebhookDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[WebhookDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=WebhookDeleteResponse,
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -524,7 +506,7 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Webhooks:
|
||||
) -> Optional[Webhooks]:
|
||||
"""
|
||||
Get details for a single webhooks destination.
|
||||
|
||||
|
|
@ -552,9 +534,9 @@ class AsyncWebhooksResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Webhooks]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Webhooks]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Webhooks], ResultWrapper[Webhooks]),
|
||||
cast_to=cast(Type[Optional[Webhooks]], ResultWrapper[Webhooks]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Type, Optional, cast
|
||||
from typing import Type, Optional, cast
|
||||
from typing_extensions import Literal
|
||||
|
||||
import httpx
|
||||
|
|
@ -118,7 +118,7 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PolicyCreateResponse:
|
||||
) -> Optional[PolicyCreateResponse]:
|
||||
"""
|
||||
Creates a new Notification policy.
|
||||
|
||||
|
|
@ -170,9 +170,9 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PolicyCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PolicyCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PolicyCreateResponse], ResultWrapper[PolicyCreateResponse]),
|
||||
cast_to=cast(Type[Optional[PolicyCreateResponse]], ResultWrapper[PolicyCreateResponse]),
|
||||
)
|
||||
|
||||
def update(
|
||||
|
|
@ -249,7 +249,7 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PolicyUpdateResponse:
|
||||
) -> Optional[PolicyUpdateResponse]:
|
||||
"""
|
||||
Update a Notification policy.
|
||||
|
||||
|
|
@ -305,9 +305,9 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PolicyUpdateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PolicyUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PolicyUpdateResponse], ResultWrapper[PolicyUpdateResponse]),
|
||||
cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -357,7 +357,7 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PolicyDeleteResponse]:
|
||||
) -> PolicyDeleteResponse:
|
||||
"""
|
||||
Delete a Notification policy.
|
||||
|
||||
|
|
@ -378,21 +378,12 @@ class PoliciesResource(SyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not policy_id:
|
||||
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
|
||||
return cast(
|
||||
Optional[PolicyDeleteResponse],
|
||||
self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PolicyDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PolicyDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PolicyDeleteResponse,
|
||||
)
|
||||
|
||||
def get(
|
||||
|
|
@ -406,7 +397,7 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Policy:
|
||||
) -> Optional[Policy]:
|
||||
"""
|
||||
Get details for a single policy.
|
||||
|
||||
|
|
@ -434,9 +425,9 @@ class PoliciesResource(SyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Policy]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Policy]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
|
||||
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -521,7 +512,7 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PolicyCreateResponse:
|
||||
) -> Optional[PolicyCreateResponse]:
|
||||
"""
|
||||
Creates a new Notification policy.
|
||||
|
||||
|
|
@ -573,9 +564,9 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PolicyCreateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PolicyCreateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PolicyCreateResponse], ResultWrapper[PolicyCreateResponse]),
|
||||
cast_to=cast(Type[Optional[PolicyCreateResponse]], ResultWrapper[PolicyCreateResponse]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
|
|
@ -652,7 +643,7 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> PolicyUpdateResponse:
|
||||
) -> Optional[PolicyUpdateResponse]:
|
||||
"""
|
||||
Update a Notification policy.
|
||||
|
||||
|
|
@ -708,9 +699,9 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[PolicyUpdateResponse]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[PolicyUpdateResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[PolicyUpdateResponse], ResultWrapper[PolicyUpdateResponse]),
|
||||
cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
|
|
@ -760,7 +751,7 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[PolicyDeleteResponse]:
|
||||
) -> PolicyDeleteResponse:
|
||||
"""
|
||||
Delete a Notification policy.
|
||||
|
||||
|
|
@ -781,21 +772,12 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
|
||||
if not policy_id:
|
||||
raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
|
||||
return cast(
|
||||
Optional[PolicyDeleteResponse],
|
||||
await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[PolicyDeleteResponse]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(
|
||||
Any, ResultWrapper[PolicyDeleteResponse]
|
||||
), # Union types cannot be passed in as arguments in the type system
|
||||
return await self._delete(
|
||||
f"/accounts/{account_id}/alerting/v3/policies/{policy_id}",
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
cast_to=PolicyDeleteResponse,
|
||||
)
|
||||
|
||||
async def get(
|
||||
|
|
@ -809,7 +791,7 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Policy:
|
||||
) -> Optional[Policy]:
|
||||
"""
|
||||
Get details for a single policy.
|
||||
|
||||
|
|
@ -837,9 +819,9 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Policy]._unwrapper,
|
||||
post_parser=ResultWrapper[Optional[Policy]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Policy], ResultWrapper[Policy]),
|
||||
cast_to=cast(Type[Optional[Policy]], ResultWrapper[Policy]),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@ from ....._response import (
|
|||
async_to_streamed_response_wrapper,
|
||||
)
|
||||
from ....._wrappers import ResultWrapper
|
||||
from .....pagination import SyncSinglePage, AsyncSinglePage
|
||||
from ....._base_client import (
|
||||
AsyncPaginator,
|
||||
make_request_options,
|
||||
)
|
||||
from .....types.zero_trust.access import Decision
|
||||
|
|
@ -31,7 +29,6 @@ from .....types.zero_trust.access_rule_param import AccessRuleParam
|
|||
from .....types.zero_trust.access.applications import policy_create_params, policy_update_params
|
||||
from .....types.zero_trust.access.applications.policy_get_response import PolicyGetResponse
|
||||
from .....types.zero_trust.access.applications.approval_group_param import ApprovalGroupParam
|
||||
from .....types.zero_trust.access.applications.policy_list_response import PolicyListResponse
|
||||
from .....types.zero_trust.access.applications.policy_create_response import PolicyCreateResponse
|
||||
from .....types.zero_trust.access.applications.policy_delete_response import PolicyDeleteResponse
|
||||
from .....types.zero_trust.access.applications.policy_update_response import PolicyUpdateResponse
|
||||
|
|
@ -296,62 +293,6 @@ class PoliciesResource(SyncAPIResource):
|
|||
cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
uuid: str,
|
||||
*,
|
||||
account_id: str | NotGiven = NOT_GIVEN,
|
||||
zone_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> SyncSinglePage[PolicyListResponse]:
|
||||
"""Lists Access policies configured for an application.
|
||||
|
||||
Returns both exclusively
|
||||
scoped and reusable policies used by the application.
|
||||
|
||||
Args:
|
||||
uuid: UUID
|
||||
|
||||
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
|
||||
|
||||
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not uuid:
|
||||
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
if not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return self._get_api_list(
|
||||
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
|
||||
page=SyncSinglePage[PolicyListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PolicyListResponse,
|
||||
)
|
||||
|
||||
def delete(
|
||||
self,
|
||||
uuid: str,
|
||||
|
|
@ -738,62 +679,6 @@ class AsyncPoliciesResource(AsyncAPIResource):
|
|||
cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]),
|
||||
)
|
||||
|
||||
def list(
|
||||
self,
|
||||
uuid: str,
|
||||
*,
|
||||
account_id: str | NotGiven = NOT_GIVEN,
|
||||
zone_id: str | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> AsyncPaginator[PolicyListResponse, AsyncSinglePage[PolicyListResponse]]:
|
||||
"""Lists Access policies configured for an application.
|
||||
|
||||
Returns both exclusively
|
||||
scoped and reusable policies used by the application.
|
||||
|
||||
Args:
|
||||
uuid: UUID
|
||||
|
||||
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
|
||||
|
||||
zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not uuid:
|
||||
raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
|
||||
if account_id and zone_id:
|
||||
raise ValueError("You cannot provide both account_id and zone_id")
|
||||
|
||||
if account_id:
|
||||
account_or_zone = "accounts"
|
||||
account_or_zone_id = account_id
|
||||
else:
|
||||
if not zone_id:
|
||||
raise ValueError("You must provide either account_id or zone_id")
|
||||
|
||||
account_or_zone = "zones"
|
||||
account_or_zone_id = zone_id
|
||||
return self._get_api_list(
|
||||
f"/{account_or_zone}/{account_or_zone_id}/access/apps/{uuid}/policies",
|
||||
page=AsyncSinglePage[PolicyListResponse],
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
||||
),
|
||||
model=PolicyListResponse,
|
||||
)
|
||||
|
||||
async def delete(
|
||||
self,
|
||||
uuid: str,
|
||||
|
|
@ -933,9 +818,6 @@ class PoliciesResourceWithRawResponse:
|
|||
self.update = to_raw_response_wrapper(
|
||||
policies.update,
|
||||
)
|
||||
self.list = to_raw_response_wrapper(
|
||||
policies.list,
|
||||
)
|
||||
self.delete = to_raw_response_wrapper(
|
||||
policies.delete,
|
||||
)
|
||||
|
|
@ -954,9 +836,6 @@ class AsyncPoliciesResourceWithRawResponse:
|
|||
self.update = async_to_raw_response_wrapper(
|
||||
policies.update,
|
||||
)
|
||||
self.list = async_to_raw_response_wrapper(
|
||||
policies.list,
|
||||
)
|
||||
self.delete = async_to_raw_response_wrapper(
|
||||
policies.delete,
|
||||
)
|
||||
|
|
@ -975,9 +854,6 @@ class PoliciesResourceWithStreamingResponse:
|
|||
self.update = to_streamed_response_wrapper(
|
||||
policies.update,
|
||||
)
|
||||
self.list = to_streamed_response_wrapper(
|
||||
policies.list,
|
||||
)
|
||||
self.delete = to_streamed_response_wrapper(
|
||||
policies.delete,
|
||||
)
|
||||
|
|
@ -996,9 +872,6 @@ class AsyncPoliciesResourceWithStreamingResponse:
|
|||
self.update = async_to_streamed_response_wrapper(
|
||||
policies.update,
|
||||
)
|
||||
self.list = async_to_streamed_response_wrapper(
|
||||
policies.list,
|
||||
)
|
||||
self.delete = async_to_streamed_response_wrapper(
|
||||
policies.delete,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from ...._base_client import (
|
|||
AsyncPaginator,
|
||||
make_request_options,
|
||||
)
|
||||
from ....types.zero_trust.access import custom_page_create_params, custom_page_update_params
|
||||
from ....types.zero_trust.access import custom_page_update_params
|
||||
from ....types.zero_trust.access.custom_page import CustomPage
|
||||
from ....types.zero_trust.access.custom_page_without_html import CustomPageWithoutHTML
|
||||
from ....types.zero_trust.access.custom_page_delete_response import CustomPageDeleteResponse
|
||||
|
|
@ -43,66 +43,6 @@ class CustomPagesResource(SyncAPIResource):
|
|||
def with_streaming_response(self) -> CustomPagesResourceWithStreamingResponse:
|
||||
return CustomPagesResourceWithStreamingResponse(self)
|
||||
|
||||
def create(
|
||||
self,
|
||||
identifier: str,
|
||||
*,
|
||||
custom_html: str,
|
||||
name: str,
|
||||
type: Literal["identity_denied", "forbidden"],
|
||||
app_count: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CustomPageWithoutHTML]:
|
||||
"""
|
||||
Create a custom page
|
||||
|
||||
Args:
|
||||
identifier: Identifier
|
||||
|
||||
custom_html: Custom page HTML.
|
||||
|
||||
name: Custom page name.
|
||||
|
||||
type: Custom page type.
|
||||
|
||||
app_count: Number of apps the custom page is assigned to.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
|
||||
return self._post(
|
||||
f"/accounts/{identifier}/access/custom_pages",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"custom_html": custom_html,
|
||||
"name": name,
|
||||
"type": type,
|
||||
"app_count": app_count,
|
||||
},
|
||||
custom_page_create_params.CustomPageCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CustomPageWithoutHTML]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CustomPageWithoutHTML]], ResultWrapper[CustomPageWithoutHTML]),
|
||||
)
|
||||
|
||||
def update(
|
||||
self,
|
||||
uuid: str,
|
||||
|
|
@ -302,66 +242,6 @@ class AsyncCustomPagesResource(AsyncAPIResource):
|
|||
def with_streaming_response(self) -> AsyncCustomPagesResourceWithStreamingResponse:
|
||||
return AsyncCustomPagesResourceWithStreamingResponse(self)
|
||||
|
||||
async def create(
|
||||
self,
|
||||
identifier: str,
|
||||
*,
|
||||
custom_html: str,
|
||||
name: str,
|
||||
type: Literal["identity_denied", "forbidden"],
|
||||
app_count: int | NotGiven = NOT_GIVEN,
|
||||
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
||||
# The extra values given here take precedence over values defined on the client or passed to this method.
|
||||
extra_headers: Headers | None = None,
|
||||
extra_query: Query | None = None,
|
||||
extra_body: Body | None = None,
|
||||
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
||||
) -> Optional[CustomPageWithoutHTML]:
|
||||
"""
|
||||
Create a custom page
|
||||
|
||||
Args:
|
||||
identifier: Identifier
|
||||
|
||||
custom_html: Custom page HTML.
|
||||
|
||||
name: Custom page name.
|
||||
|
||||
type: Custom page type.
|
||||
|
||||
app_count: Number of apps the custom page is assigned to.
|
||||
|
||||
extra_headers: Send extra headers
|
||||
|
||||
extra_query: Add additional query parameters to the request
|
||||
|
||||
extra_body: Add additional JSON properties to the request
|
||||
|
||||
timeout: Override the client-level default timeout for this request, in seconds
|
||||
"""
|
||||
if not identifier:
|
||||
raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
|
||||
return await self._post(
|
||||
f"/accounts/{identifier}/access/custom_pages",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"custom_html": custom_html,
|
||||
"name": name,
|
||||
"type": type,
|
||||
"app_count": app_count,
|
||||
},
|
||||
custom_page_create_params.CustomPageCreateParams,
|
||||
),
|
||||
options=make_request_options(
|
||||
extra_headers=extra_headers,
|
||||
extra_query=extra_query,
|
||||
extra_body=extra_body,
|
||||
timeout=timeout,
|
||||
post_parser=ResultWrapper[Optional[CustomPageWithoutHTML]]._unwrapper,
|
||||
),
|
||||
cast_to=cast(Type[Optional[CustomPageWithoutHTML]], ResultWrapper[CustomPageWithoutHTML]),
|
||||
)
|
||||
|
||||
async def update(
|
||||
self,
|
||||
uuid: str,
|
||||
|
|
@ -556,9 +436,6 @@ class CustomPagesResourceWithRawResponse:
|
|||
def __init__(self, custom_pages: CustomPagesResource) -> None:
|
||||
self._custom_pages = custom_pages
|
||||
|
||||
self.create = to_raw_response_wrapper(
|
||||
custom_pages.create,
|
||||
)
|
||||
self.update = to_raw_response_wrapper(
|
||||
custom_pages.update,
|
||||
)
|
||||
|
|
@ -577,9 +454,6 @@ class AsyncCustomPagesResourceWithRawResponse:
|
|||
def __init__(self, custom_pages: AsyncCustomPagesResource) -> None:
|
||||
self._custom_pages = custom_pages
|
||||
|
||||
self.create = async_to_raw_response_wrapper(
|
||||
custom_pages.create,
|
||||
)
|
||||
self.update = async_to_raw_response_wrapper(
|
||||
custom_pages.update,
|
||||
)
|
||||
|
|
@ -598,9 +472,6 @@ class CustomPagesResourceWithStreamingResponse:
|
|||
def __init__(self, custom_pages: CustomPagesResource) -> None:
|
||||
self._custom_pages = custom_pages
|
||||
|
||||
self.create = to_streamed_response_wrapper(
|
||||
custom_pages.create,
|
||||
)
|
||||
self.update = to_streamed_response_wrapper(
|
||||
custom_pages.update,
|
||||
)
|
||||
|
|
@ -619,9 +490,6 @@ class AsyncCustomPagesResourceWithStreamingResponse:
|
|||
def __init__(self, custom_pages: AsyncCustomPagesResource) -> None:
|
||||
self._custom_pages = custom_pages
|
||||
|
||||
self.create = async_to_streamed_response_wrapper(
|
||||
custom_pages.create,
|
||||
)
|
||||
self.update = async_to_streamed_response_wrapper(
|
||||
custom_pages.update,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,27 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
__all__ = ["AvailableAlertListResponse"]
|
||||
from ..._models import BaseModel
|
||||
|
||||
AvailableAlertListResponse = Union[List[object], str, object, None]
|
||||
__all__ = ["AvailableAlertListResponse", "AvailableAlertListResponseItem"]
|
||||
|
||||
|
||||
class AvailableAlertListResponseItem(BaseModel):
|
||||
description: Optional[str] = None
|
||||
"""Describes the alert type."""
|
||||
|
||||
display_name: Optional[str] = None
|
||||
"""Alert type name."""
|
||||
|
||||
filter_options: Optional[List[object]] = None
|
||||
"""Format of additional configuration options (filters) for the alert type.
|
||||
|
||||
Data type of filters during policy creation: Array of strings.
|
||||
"""
|
||||
|
||||
type: Optional[str] = None
|
||||
"""Use this value when creating and updating a notification policy."""
|
||||
|
||||
|
||||
AvailableAlertListResponse = Dict[str, List[AvailableAlertListResponseItem]]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,26 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union
|
||||
from typing import Dict, List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["EligibleGetResponse"]
|
||||
from ...._models import BaseModel
|
||||
|
||||
EligibleGetResponse = Union[List[object], str, object, None]
|
||||
__all__ = ["EligibleGetResponse", "EligibleGetResponseItem"]
|
||||
|
||||
|
||||
class EligibleGetResponseItem(BaseModel):
|
||||
eligible: Optional[bool] = None
|
||||
"""Determines whether or not the account is eligible for the delivery mechanism."""
|
||||
|
||||
ready: Optional[bool] = None
|
||||
"""Beta flag.
|
||||
|
||||
Users can create a policy with a mechanism that is not ready, but we cannot
|
||||
guarantee successful delivery of notifications.
|
||||
"""
|
||||
|
||||
type: Optional[Literal["email", "pagerduty", "webhook"]] = None
|
||||
"""Determines type of delivery mechanism."""
|
||||
|
||||
|
||||
EligibleGetResponse = Dict[str, List[EligibleGetResponseItem]]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,34 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["PagerdutyDeleteResponse"]
|
||||
from ...._models import BaseModel
|
||||
from ...shared.response_info import ResponseInfo
|
||||
|
||||
PagerdutyDeleteResponse = Union[List[object], str, object, None]
|
||||
__all__ = ["PagerdutyDeleteResponse", "ResultInfo"]
|
||||
|
||||
|
||||
class ResultInfo(BaseModel):
|
||||
count: Optional[float] = None
|
||||
"""Total number of results for the requested service"""
|
||||
|
||||
page: Optional[float] = None
|
||||
"""Current page within paginated list of results"""
|
||||
|
||||
per_page: Optional[float] = None
|
||||
"""Number of results per page of results"""
|
||||
|
||||
total_count: Optional[float] = None
|
||||
"""Total results available without any search parameters"""
|
||||
|
||||
|
||||
class PagerdutyDeleteResponse(BaseModel):
|
||||
errors: List[ResponseInfo]
|
||||
|
||||
messages: List[ResponseInfo]
|
||||
|
||||
success: Literal[True]
|
||||
"""Whether the API call was successful"""
|
||||
|
||||
result_info: Optional[ResultInfo] = None
|
||||
|
|
|
|||
|
|
@ -1,7 +1,34 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["WebhookDeleteResponse"]
|
||||
from ...._models import BaseModel
|
||||
from ...shared.response_info import ResponseInfo
|
||||
|
||||
WebhookDeleteResponse = Union[List[object], str, object, None]
|
||||
__all__ = ["WebhookDeleteResponse", "ResultInfo"]
|
||||
|
||||
|
||||
class ResultInfo(BaseModel):
|
||||
count: Optional[float] = None
|
||||
"""Total number of results for the requested service"""
|
||||
|
||||
page: Optional[float] = None
|
||||
"""Current page within paginated list of results"""
|
||||
|
||||
per_page: Optional[float] = None
|
||||
"""Number of results per page of results"""
|
||||
|
||||
total_count: Optional[float] = None
|
||||
"""Total results available without any search parameters"""
|
||||
|
||||
|
||||
class WebhookDeleteResponse(BaseModel):
|
||||
errors: List[ResponseInfo]
|
||||
|
||||
messages: List[ResponseInfo]
|
||||
|
||||
success: Literal[True]
|
||||
"""Whether the API call was successful"""
|
||||
|
||||
result_info: Optional[ResultInfo] = None
|
||||
|
|
|
|||
|
|
@ -1,7 +1,34 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Union
|
||||
from typing import List, Optional
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["PolicyDeleteResponse"]
|
||||
from ..._models import BaseModel
|
||||
from ..shared.response_info import ResponseInfo
|
||||
|
||||
PolicyDeleteResponse = Union[List[object], str, object, None]
|
||||
__all__ = ["PolicyDeleteResponse", "ResultInfo"]
|
||||
|
||||
|
||||
class ResultInfo(BaseModel):
|
||||
count: Optional[float] = None
|
||||
"""Total number of results for the requested service"""
|
||||
|
||||
page: Optional[float] = None
|
||||
"""Current page within paginated list of results"""
|
||||
|
||||
per_page: Optional[float] = None
|
||||
"""Number of results per page of results"""
|
||||
|
||||
total_count: Optional[float] = None
|
||||
"""Total results available without any search parameters"""
|
||||
|
||||
|
||||
class PolicyDeleteResponse(BaseModel):
|
||||
errors: List[ResponseInfo]
|
||||
|
||||
messages: List[ResponseInfo]
|
||||
|
||||
success: Literal[True]
|
||||
"""Whether the API call was successful"""
|
||||
|
||||
result_info: Optional[ResultInfo] = None
|
||||
|
|
|
|||
|
|
@ -201,6 +201,9 @@ class DeploymentConfigsPreviewQueueProducers(BaseModel):
|
|||
|
||||
|
||||
class DeploymentConfigsPreviewR2BucketsR2Binding(BaseModel):
|
||||
jurisdiction: Optional[str] = None
|
||||
"""Jurisdiction of the R2 bucket."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""Name of the R2 bucket."""
|
||||
|
||||
|
|
@ -398,6 +401,9 @@ class DeploymentConfigsProductionQueueProducers(BaseModel):
|
|||
|
||||
|
||||
class DeploymentConfigsProductionR2BucketsR2Binding(BaseModel):
|
||||
jurisdiction: Optional[str] = None
|
||||
"""Jurisdiction of the R2 bucket."""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""Name of the R2 bucket."""
|
||||
|
||||
|
|
|
|||
|
|
@ -218,6 +218,9 @@ class DeploymentConfigsPreviewQueueProducers(TypedDict, total=False):
|
|||
|
||||
|
||||
class DeploymentConfigsPreviewR2BucketsR2Binding(TypedDict, total=False):
|
||||
jurisdiction: Optional[str]
|
||||
"""Jurisdiction of the R2 bucket."""
|
||||
|
||||
name: str
|
||||
"""Name of the R2 bucket."""
|
||||
|
||||
|
|
@ -410,6 +413,9 @@ class DeploymentConfigsProductionQueueProducers(TypedDict, total=False):
|
|||
|
||||
|
||||
class DeploymentConfigsProductionR2BucketsR2Binding(TypedDict, total=False):
|
||||
jurisdiction: Optional[str]
|
||||
"""Jurisdiction of the R2 bucket."""
|
||||
|
||||
name: str
|
||||
"""Name of the R2 bucket."""
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ __all__ = ["Result", "UnionMember0", "AaaAPIResponseCommon"]
|
|||
|
||||
|
||||
class UnionMember0(BaseModel):
|
||||
errors: Optional[object] = None
|
||||
errors: Optional[List[ResponseInfo]] = None
|
||||
|
||||
messages: Optional[List[object]] = None
|
||||
messages: Optional[List[ResponseInfo]] = None
|
||||
|
||||
result: Optional[List[AuditLog]] = None
|
||||
|
||||
|
|
@ -25,8 +25,6 @@ class AaaAPIResponseCommon(BaseModel):
|
|||
|
||||
messages: List[ResponseInfo]
|
||||
|
||||
result: Union[List[object], str, object]
|
||||
|
||||
success: Literal[True]
|
||||
"""Whether the API call was successful"""
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ from .application_list_response import ApplicationListResponse as ApplicationLis
|
|||
from .application_update_params import ApplicationUpdateParams as ApplicationUpdateParams
|
||||
from .certificate_create_params import CertificateCreateParams as CertificateCreateParams
|
||||
from .certificate_update_params import CertificateUpdateParams as CertificateUpdateParams
|
||||
from .custom_page_create_params import CustomPageCreateParams as CustomPageCreateParams
|
||||
from .custom_page_update_params import CustomPageUpdateParams as CustomPageUpdateParams
|
||||
from .application_create_response import ApplicationCreateResponse as ApplicationCreateResponse
|
||||
from .application_delete_response import ApplicationDeleteResponse as ApplicationDeleteResponse
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ from .ca_delete_response import CADeleteResponse as CADeleteResponse
|
|||
from .policy_get_response import PolicyGetResponse as PolicyGetResponse
|
||||
from .approval_group_param import ApprovalGroupParam as ApprovalGroupParam
|
||||
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
|
||||
from .policy_list_response import PolicyListResponse as PolicyListResponse
|
||||
from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams
|
||||
from .user_policy_check_geo import UserPolicyCheckGeo as UserPolicyCheckGeo
|
||||
from .policy_create_response import PolicyCreateResponse as PolicyCreateResponse
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
from ..decision import Decision
|
||||
from ....._models import BaseModel
|
||||
from ...access_rule import AccessRule
|
||||
from .approval_group import ApprovalGroup
|
||||
|
||||
__all__ = ["PolicyListResponse"]
|
||||
|
||||
|
||||
class PolicyListResponse(BaseModel):
|
||||
id: Optional[str] = None
|
||||
"""UUID"""
|
||||
|
||||
approval_groups: Optional[List[ApprovalGroup]] = None
|
||||
"""Administrators who can approve a temporary authentication request."""
|
||||
|
||||
approval_required: Optional[bool] = None
|
||||
"""
|
||||
Requires the user to request access from an administrator at the start of each
|
||||
session.
|
||||
"""
|
||||
|
||||
created_at: Optional[datetime] = None
|
||||
|
||||
decision: Optional[Decision] = None
|
||||
"""The action Access will take if a user matches this policy."""
|
||||
|
||||
exclude: Optional[List[AccessRule]] = None
|
||||
"""Rules evaluated with a NOT logical operator.
|
||||
|
||||
To match the policy, a user cannot meet any of the Exclude rules.
|
||||
"""
|
||||
|
||||
include: Optional[List[AccessRule]] = None
|
||||
"""Rules evaluated with an OR logical operator.
|
||||
|
||||
A user needs to meet only one of the Include rules.
|
||||
"""
|
||||
|
||||
isolation_required: Optional[bool] = None
|
||||
"""
|
||||
Require this application to be served in an isolated browser for users matching
|
||||
this policy. 'Client Web Isolation' must be on for the account in order to use
|
||||
this feature.
|
||||
"""
|
||||
|
||||
name: Optional[str] = None
|
||||
"""The name of the Access policy."""
|
||||
|
||||
purpose_justification_prompt: Optional[str] = None
|
||||
"""A custom message that will appear on the purpose justification screen."""
|
||||
|
||||
purpose_justification_required: Optional[bool] = None
|
||||
"""Require users to enter a justification when they log in to the application."""
|
||||
|
||||
require: Optional[List[AccessRule]] = None
|
||||
"""Rules evaluated with an AND logical operator.
|
||||
|
||||
To match the policy, a user must meet all of the Require rules.
|
||||
"""
|
||||
|
||||
session_duration: Optional[str] = None
|
||||
"""The amount of time that tokens issued for the application will be valid.
|
||||
|
||||
Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs),
|
||||
ms, s, m, h.
|
||||
"""
|
||||
|
||||
updated_at: Optional[datetime] = None
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing_extensions import Literal, Required, TypedDict
|
||||
|
||||
__all__ = ["CustomPageCreateParams"]
|
||||
|
||||
|
||||
class CustomPageCreateParams(TypedDict, total=False):
|
||||
custom_html: Required[str]
|
||||
"""Custom page HTML."""
|
||||
|
||||
name: Required[str]
|
||||
"""Custom page name."""
|
||||
|
||||
type: Required[Literal["identity_denied", "forbidden"]]
|
||||
"""Custom page type."""
|
||||
|
||||
app_count: int
|
||||
"""Number of apps the custom page is assigned to."""
|
||||
|
|
@ -27,7 +27,7 @@ class TestPagerduty:
|
|||
pagerduty = client.alerting.destinations.pagerduty.create(
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -38,7 +38,7 @@ class TestPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -49,7 +49,7 @@ class TestPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ class TestPagerduty:
|
|||
pagerduty = client.alerting.destinations.pagerduty.delete(
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -76,7 +76,7 @@ class TestPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -87,7 +87,7 @@ class TestPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ class TestPagerduty:
|
|||
"8c71e667571b4f61b94d9e4b12158038",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_link(self, client: Cloudflare) -> None:
|
||||
|
|
@ -154,7 +154,7 @@ class TestPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_link(self, client: Cloudflare) -> None:
|
||||
|
|
@ -166,7 +166,7 @@ class TestPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = response.parse()
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ class TestAsyncPagerduty:
|
|||
pagerduty = await async_client.alerting.destinations.pagerduty.create(
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -204,7 +204,7 @@ class TestAsyncPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -215,7 +215,7 @@ class TestAsyncPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(PagerdutyCreateResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyCreateResponse], pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ class TestAsyncPagerduty:
|
|||
pagerduty = await async_client.alerting.destinations.pagerduty.delete(
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -242,7 +242,7 @@ class TestAsyncPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -253,7 +253,7 @@ class TestAsyncPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(Optional[PagerdutyDeleteResponse], pagerduty, path=["response"])
|
||||
assert_matches_type(PagerdutyDeleteResponse, pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -308,7 +308,7 @@ class TestAsyncPagerduty:
|
|||
"8c71e667571b4f61b94d9e4b12158038",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_link(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -320,7 +320,7 @@ class TestAsyncPagerduty:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_link(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -332,7 +332,7 @@ class TestAsyncPagerduty:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
pagerduty = await response.parse()
|
||||
assert_matches_type(PagerdutyLinkResponse, pagerduty, path=["response"])
|
||||
assert_matches_type(Optional[PagerdutyLinkResponse], pagerduty, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class TestWebhooks:
|
|||
name="Slack Webhook",
|
||||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
)
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
|
|
@ -40,7 +40,7 @@ class TestWebhooks:
|
|||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
secret="string",
|
||||
)
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -53,7 +53,7 @@ class TestWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = response.parse()
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -66,7 +66,7 @@ class TestWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = response.parse()
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ class TestWebhooks:
|
|||
name="Slack Webhook",
|
||||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
)
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
|
|
@ -98,7 +98,7 @@ class TestWebhooks:
|
|||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
secret="string",
|
||||
)
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
|
|
@ -112,7 +112,7 @@ class TestWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = response.parse()
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
|
|
@ -126,7 +126,7 @@ class TestWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = response.parse()
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ class TestWebhooks:
|
|||
"b115d5ec-15c6-41ee-8b76-92c449b5227b",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -204,7 +204,7 @@ class TestWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = response.parse()
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -216,7 +216,7 @@ class TestWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = response.parse()
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ class TestWebhooks:
|
|||
"b115d5ec-15c6-41ee-8b76-92c449b5227b",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
|
|
@ -252,7 +252,7 @@ class TestWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = response.parse()
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
|
|
@ -264,7 +264,7 @@ class TestWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = response.parse()
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ class TestAsyncWebhooks:
|
|||
name="Slack Webhook",
|
||||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
)
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -303,7 +303,7 @@ class TestAsyncWebhooks:
|
|||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
secret="string",
|
||||
)
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -316,7 +316,7 @@ class TestAsyncWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -329,7 +329,7 @@ class TestAsyncWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(WebhookCreateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookCreateResponse], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ class TestAsyncWebhooks:
|
|||
name="Slack Webhook",
|
||||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
)
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -361,7 +361,7 @@ class TestAsyncWebhooks:
|
|||
url="https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd",
|
||||
secret="string",
|
||||
)
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -375,7 +375,7 @@ class TestAsyncWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -389,7 +389,7 @@ class TestAsyncWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(WebhookUpdateResponse, webhook, path=["response"])
|
||||
assert_matches_type(Optional[WebhookUpdateResponse], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -455,7 +455,7 @@ class TestAsyncWebhooks:
|
|||
"b115d5ec-15c6-41ee-8b76-92c449b5227b",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -467,7 +467,7 @@ class TestAsyncWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -479,7 +479,7 @@ class TestAsyncWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(Optional[WebhookDeleteResponse], webhook, path=["response"])
|
||||
assert_matches_type(WebhookDeleteResponse, webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ class TestAsyncWebhooks:
|
|||
"b115d5ec-15c6-41ee-8b76-92c449b5227b",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -515,7 +515,7 @@ class TestAsyncWebhooks:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -527,7 +527,7 @@ class TestAsyncWebhooks:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
webhook = await response.parse()
|
||||
assert_matches_type(Webhooks, webhook, path=["response"])
|
||||
assert_matches_type(Optional[Webhooks], webhook, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class TestPolicies:
|
|||
},
|
||||
name="SSL Notification Event Policy",
|
||||
)
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
|
|
@ -94,7 +94,7 @@ class TestPolicies:
|
|||
"zones": ["string", "string", "string"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -113,7 +113,7 @@ class TestPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = response.parse()
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
|
|
@ -132,7 +132,7 @@ class TestPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = response.parse()
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ class TestPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_method_update_with_all_params(self, client: Cloudflare) -> None:
|
||||
|
|
@ -216,7 +216,7 @@ class TestPolicies:
|
|||
},
|
||||
name="SSL Notification Event Policy",
|
||||
)
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_update(self, client: Cloudflare) -> None:
|
||||
|
|
@ -228,7 +228,7 @@ class TestPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = response.parse()
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_update(self, client: Cloudflare) -> None:
|
||||
|
|
@ -240,7 +240,7 @@ class TestPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = response.parse()
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ class TestPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -314,7 +314,7 @@ class TestPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = response.parse()
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -326,7 +326,7 @@ class TestPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = response.parse()
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ class TestPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_get(self, client: Cloudflare) -> None:
|
||||
|
|
@ -362,7 +362,7 @@ class TestPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = response.parse()
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_get(self, client: Cloudflare) -> None:
|
||||
|
|
@ -374,7 +374,7 @@ class TestPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = response.parse()
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ class TestAsyncPolicies:
|
|||
},
|
||||
name="SSL Notification Event Policy",
|
||||
)
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -467,7 +467,7 @@ class TestAsyncPolicies:
|
|||
"zones": ["string", "string", "string"],
|
||||
},
|
||||
)
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -486,7 +486,7 @@ class TestAsyncPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = await response.parse()
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -505,7 +505,7 @@ class TestAsyncPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = await response.parse()
|
||||
assert_matches_type(PolicyCreateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -530,7 +530,7 @@ class TestAsyncPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -589,7 +589,7 @@ class TestAsyncPolicies:
|
|||
},
|
||||
name="SSL Notification Event Policy",
|
||||
)
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -601,7 +601,7 @@ class TestAsyncPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = await response.parse()
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -613,7 +613,7 @@ class TestAsyncPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = await response.parse()
|
||||
assert_matches_type(PolicyUpdateResponse, policy, path=["response"])
|
||||
assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -675,7 +675,7 @@ class TestAsyncPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -687,7 +687,7 @@ class TestAsyncPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = await response.parse()
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -699,7 +699,7 @@ class TestAsyncPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = await response.parse()
|
||||
assert_matches_type(Optional[PolicyDeleteResponse], policy, path=["response"])
|
||||
assert_matches_type(PolicyDeleteResponse, policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
@ -723,7 +723,7 @@ class TestAsyncPolicies:
|
|||
"0da2b59e-f118-439d-8097-bdfb215203c9",
|
||||
account_id="023e105f4ecef8ad9ca31a8372d0c353",
|
||||
)
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -735,7 +735,7 @@ class TestAsyncPolicies:
|
|||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = await response.parse()
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
@ -747,7 +747,7 @@ class TestAsyncPolicies:
|
|||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = await response.parse()
|
||||
assert_matches_type(Policy, policy, path=["response"])
|
||||
assert_matches_type(Optional[Policy], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,12 @@ class TestProjects:
|
|||
"mtls_certificates": {"mtls": {"certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"}},
|
||||
"placement": {"mode": "smart"},
|
||||
"queue_producers": {"queue_producer_binding": {"name": "some-queue"}},
|
||||
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
|
||||
"r2_buckets": {
|
||||
"r2_binding": {
|
||||
"jurisdiction": "eu",
|
||||
"name": "some-bucket",
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"service_binding": {
|
||||
"entrypoint": "MyHandler",
|
||||
|
|
@ -92,7 +97,12 @@ class TestProjects:
|
|||
"mtls_certificates": {"mtls": {"certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"}},
|
||||
"placement": {"mode": "smart"},
|
||||
"queue_producers": {"queue_producer_binding": {"name": "some-queue"}},
|
||||
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
|
||||
"r2_buckets": {
|
||||
"r2_binding": {
|
||||
"jurisdiction": "eu",
|
||||
"name": "some-bucket",
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"service_binding": {
|
||||
"entrypoint": "MyHandler",
|
||||
|
|
@ -494,7 +504,12 @@ class TestAsyncProjects:
|
|||
"mtls_certificates": {"mtls": {"certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"}},
|
||||
"placement": {"mode": "smart"},
|
||||
"queue_producers": {"queue_producer_binding": {"name": "some-queue"}},
|
||||
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
|
||||
"r2_buckets": {
|
||||
"r2_binding": {
|
||||
"jurisdiction": "eu",
|
||||
"name": "some-bucket",
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"service_binding": {
|
||||
"entrypoint": "MyHandler",
|
||||
|
|
@ -523,7 +538,12 @@ class TestAsyncProjects:
|
|||
"mtls_certificates": {"mtls": {"certificate_id": "d7cdd17c-916f-4cb7-aabe-585eb382ec4e"}},
|
||||
"placement": {"mode": "smart"},
|
||||
"queue_producers": {"queue_producer_binding": {"name": "some-queue"}},
|
||||
"r2_buckets": {"r2_binding": {"name": "some-bucket"}},
|
||||
"r2_buckets": {
|
||||
"r2_binding": {
|
||||
"jurisdiction": "eu",
|
||||
"name": "some-bucket",
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"service_binding": {
|
||||
"entrypoint": "MyHandler",
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ import pytest
|
|||
|
||||
from cloudflare import Cloudflare, AsyncCloudflare
|
||||
from tests.utils import assert_matches_type
|
||||
from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
|
||||
from cloudflare.types.zero_trust.access.applications import (
|
||||
PolicyGetResponse,
|
||||
PolicyListResponse,
|
||||
PolicyCreateResponse,
|
||||
PolicyDeleteResponse,
|
||||
PolicyUpdateResponse,
|
||||
|
|
@ -333,73 +331,6 @@ class TestPolicies:
|
|||
account_id="string",
|
||||
)
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_method_list(self, client: Cloudflare) -> None:
|
||||
policy = client.zero_trust.access.applications.policies.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
|
||||
policy = client.zero_trust.access.applications.policies.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_raw_response_list(self, client: Cloudflare) -> None:
|
||||
response = client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = response.parse()
|
||||
assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_streaming_response_list(self, client: Cloudflare) -> None:
|
||||
with client.zero_trust.access.applications.policies.with_streaming_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = response.parse()
|
||||
assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_path_params_list(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
|
||||
client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
|
||||
client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
|
||||
client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
def test_method_delete(self, client: Cloudflare) -> None:
|
||||
|
|
@ -875,73 +806,6 @@ class TestAsyncPolicies:
|
|||
account_id="string",
|
||||
)
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
|
||||
policy = await async_client.zero_trust.access.applications.policies.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
policy = await async_client.zero_trust.access.applications.policies.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
policy = await response.parse()
|
||||
assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.zero_trust.access.applications.policies.with_streaming_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
policy = await response.parse()
|
||||
assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"):
|
||||
await async_client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
|
||||
await async_client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="",
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
|
||||
await async_client.zero_trust.access.applications.policies.with_raw_response.list(
|
||||
"f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
|
||||
account_id="string",
|
||||
)
|
||||
|
||||
@pytest.mark.skip(reason="TODO: investigate broken test")
|
||||
@parametrize
|
||||
async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
|
||||
|
|
|
|||
|
|
@ -22,67 +22,6 @@ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
|
|||
class TestCustomPages:
|
||||
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@parametrize
|
||||
def test_method_create(self, client: Cloudflare) -> None:
|
||||
custom_page = client.zero_trust.access.custom_pages.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_method_create_with_all_params(self, client: Cloudflare) -> None:
|
||||
custom_page = client.zero_trust.access.custom_pages.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
app_count=0,
|
||||
)
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_raw_response_create(self, client: Cloudflare) -> None:
|
||||
response = client.zero_trust.access.custom_pages.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
custom_page = response.parse()
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
def test_streaming_response_create(self, client: Cloudflare) -> None:
|
||||
with client.zero_trust.access.custom_pages.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
custom_page = response.parse()
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@parametrize
|
||||
def test_path_params_create(self, client: Cloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"):
|
||||
client.zero_trust.access.custom_pages.with_raw_response.create(
|
||||
"",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
def test_method_update(self, client: Cloudflare) -> None:
|
||||
custom_page = client.zero_trust.access.custom_pages.update(
|
||||
|
|
@ -296,67 +235,6 @@ class TestCustomPages:
|
|||
class TestAsyncCustomPages:
|
||||
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_create(self, async_client: AsyncCloudflare) -> None:
|
||||
custom_page = await async_client.zero_trust.access.custom_pages.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None:
|
||||
custom_page = await async_client.zero_trust.access.custom_pages.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
app_count=0,
|
||||
)
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
response = await async_client.zero_trust.access.custom_pages.with_raw_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
|
||||
assert response.is_closed is True
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
custom_page = await response.parse()
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
@parametrize
|
||||
async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
|
||||
async with async_client.zero_trust.access.custom_pages.with_streaming_response.create(
|
||||
"023e105f4ecef8ad9ca31a8372d0c353",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
) as response:
|
||||
assert not response.is_closed
|
||||
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
|
||||
|
||||
custom_page = await response.parse()
|
||||
assert_matches_type(Optional[CustomPageWithoutHTML], custom_page, path=["response"])
|
||||
|
||||
assert cast(Any, response.is_closed) is True
|
||||
|
||||
@parametrize
|
||||
async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
|
||||
with pytest.raises(ValueError, match=r"Expected a non-empty value for `identifier` but received ''"):
|
||||
await async_client.zero_trust.access.custom_pages.with_raw_response.create(
|
||||
"",
|
||||
custom_html="<html><body><h1>Access Denied</h1></body></html>",
|
||||
name="string",
|
||||
type="identity_denied",
|
||||
)
|
||||
|
||||
@parametrize
|
||||
async def test_method_update(self, async_client: AsyncCloudflare) -> None:
|
||||
custom_page = await async_client.zero_trust.access.custom_pages.update(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue