From 502a37fdd5d941b8c25b12d50ccc17fc67d6f66b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 23:11:22 +0000 Subject: [PATCH] fix(api): better support union schemas with common properties --- api.md | 35 +- .../resources/magic_transit/apps.py | 380 ++-------- .../hostnames/certificates.py | 14 +- .../origin_tls_client_auth.py | 61 +- src/cloudflare/resources/queues/consumers.py | 16 + src/cloudflare/resources/rulesets/rules.py | 320 ++++++-- .../access/applications/policies.py | 53 +- .../applications/policy_tests/policy_tests.py | 59 ++ .../resources/zero_trust/access/policies.py | 117 +++ .../resources/zero_trust/dlp/entries.py | 10 + .../custom_hostname_create_response.py | 2 - .../custom_hostname_edit_response.py | 2 - .../custom_hostname_get_response.py | 2 - .../custom_hostname_list_response.py | 2 - src/cloudflare/types/dns/batch_patch_param.py | 179 ++++- src/cloudflare/types/dns/batch_put_param.py | 195 ++++- src/cloudflare/types/dns/record_response.py | 572 +++++++++++++- .../types/magic_transit/app_create_params.py | 24 +- .../types/magic_transit/app_update_params.py | 38 +- .../managed_transform_edit_response.py | 20 +- .../managed_transform_list_response.py | 20 +- .../types/origin_tls_client_auth/__init__.py | 8 + .../hostname_update_response.py | 33 +- .../hostnames/__init__.py | 1 + .../hostnames/certificate_list_response.py | 33 + .../origin_tls_client_auth_create_response.py | 21 + .../origin_tls_client_auth_delete_response.py | 21 + .../origin_tls_client_auth_get_response.py | 21 + .../origin_tls_client_auth_list_response.py | 21 + .../types/queues/consumer_create_params.py | 4 + .../types/queues/consumer_update_params.py | 4 + .../types/rules/lists/item_get_response.py | 79 +- .../types/rules/lists/item_list_response.py | 79 +- .../types/rulesets/rule_create_params.py | 706 ++++++++++++++++-- .../types/rulesets/rule_edit_params.py | 706 ++++++++++++++++-- .../types/zero_trust/access/__init__.py | 1 + .../access/application_create_params.py | 24 + .../access/application_create_response.py | 101 ++- .../access/application_get_response.py | 101 ++- .../access/application_list_response.py | 101 ++- .../zero_trust/access/application_policy.py | 30 + .../access/application_update_params.py | 24 + .../access/application_update_response.py | 101 ++- .../access/applications/__init__.py | 4 + .../applications/policy_create_response.py | 15 + .../applications/policy_get_response.py | 15 + .../applications/policy_list_response.py | 15 + .../applications/policy_test_create_params.py | 30 + .../applications/policy_update_response.py | 15 + .../types/zero_trust/access/approval_group.py | 18 + .../zero_trust/access/policy_create_params.py | 30 + .../access/policy_create_response.py | 36 + .../zero_trust/access/policy_get_response.py | 36 + .../zero_trust/access/policy_list_response.py | 36 + .../zero_trust/access/policy_update_params.py | 30 + .../access/policy_update_response.py | 36 + .../zero_trust/dlp/entry_update_params.py | 6 + tests/api_resources/dns/test_records.py | 4 + .../api_resources/magic_transit/test_apps.py | 546 ++------------ .../hostnames/test_certificates.py | 14 +- tests/api_resources/queues/test_consumers.py | 8 + tests/api_resources/rulesets/test_rules.py | 72 ++ .../test_origin_tls_client_auth.py | 59 +- .../access/applications/test_policies.py | 69 +- .../access/applications/test_policy_tests.py | 34 + .../zero_trust/access/test_applications.py | 24 + .../zero_trust/access/test_policies.py | 68 ++ .../zero_trust/dlp/test_entries.py | 46 ++ 68 files changed, 4310 insertions(+), 1297 deletions(-) create mode 100644 src/cloudflare/types/origin_tls_client_auth/hostnames/certificate_list_response.py create mode 100644 src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_response.py create mode 100644 src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_delete_response.py create mode 100644 src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_get_response.py create mode 100644 src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_list_response.py create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_create_response.py create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_get_response.py create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_list_response.py create mode 100644 src/cloudflare/types/zero_trust/access/applications/policy_update_response.py create mode 100644 src/cloudflare/types/zero_trust/access/approval_group.py diff --git a/api.md b/api.md index 373dd369c6d..e37f2fa9403 100644 --- a/api.md +++ b/api.md @@ -2012,15 +2012,21 @@ Methods: Types: ```python -from cloudflare.types.origin_tls_client_auth import ZoneAuthenticatedOriginPull +from cloudflare.types.origin_tls_client_auth import ( + ZoneAuthenticatedOriginPull, + OriginTLSClientAuthCreateResponse, + OriginTLSClientAuthListResponse, + OriginTLSClientAuthDeleteResponse, + OriginTLSClientAuthGetResponse, +) ``` Methods: -- client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> Optional[ZoneAuthenticatedOriginPull] -- client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[ZoneAuthenticatedOriginPull] -- client.origin_tls_client_auth.delete(certificate_id, \*, zone_id) -> Optional[ZoneAuthenticatedOriginPull] -- client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> Optional[ZoneAuthenticatedOriginPull] +- client.origin_tls_client_auth.create(\*, zone_id, \*\*params) -> Optional[OriginTLSClientAuthCreateResponse] +- client.origin_tls_client_auth.list(\*, zone_id) -> SyncSinglePage[OriginTLSClientAuthListResponse] +- client.origin_tls_client_auth.delete(certificate_id, \*, zone_id) -> Optional[OriginTLSClientAuthDeleteResponse] +- client.origin_tls_client_auth.get(certificate_id, \*, zone_id) -> Optional[OriginTLSClientAuthGetResponse] ## Hostnames @@ -2043,6 +2049,7 @@ Types: from cloudflare.types.origin_tls_client_auth.hostnames import ( Certificate, CertificateCreateResponse, + CertificateListResponse, CertificateDeleteResponse, CertificateGetResponse, ) @@ -2051,7 +2058,7 @@ from cloudflare.types.origin_tls_client_auth.hostnames import ( Methods: - client.origin_tls_client_auth.hostnames.certificates.create(\*, zone_id, \*\*params) -> Optional[CertificateCreateResponse] -- client.origin_tls_client_auth.hostnames.certificates.list(\*, zone_id) -> SyncSinglePage[AuthenticatedOriginPull] +- client.origin_tls_client_auth.hostnames.certificates.list(\*, zone_id) -> SyncSinglePage[CertificateListResponse] - client.origin_tls_client_auth.hostnames.certificates.delete(certificate_id, \*, zone_id) -> Optional[CertificateDeleteResponse] - client.origin_tls_client_auth.hostnames.certificates.get(certificate_id, \*, zone_id) -> Optional[CertificateGetResponse] @@ -5338,16 +5345,22 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access.applications import PolicyDeleteResponse +from cloudflare.types.zero_trust.access.applications import ( + PolicyCreateResponse, + PolicyUpdateResponse, + PolicyListResponse, + PolicyDeleteResponse, + PolicyGetResponse, +) ``` Methods: -- client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[ApplicationPolicy] -- client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[ApplicationPolicy] -- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id) -> SyncSinglePage[ApplicationPolicy] +- client.zero_trust.access.applications.policies.create(app_id, \*, account_id, zone_id, \*\*params) -> Optional[PolicyCreateResponse] +- client.zero_trust.access.applications.policies.update(policy_id, \*, app_id, account_id, zone_id, \*\*params) -> Optional[PolicyUpdateResponse] +- client.zero_trust.access.applications.policies.list(app_id, \*, account_id, zone_id) -> SyncSinglePage[PolicyListResponse] - client.zero_trust.access.applications.policies.delete(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyDeleteResponse] -- client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[ApplicationPolicy] +- client.zero_trust.access.applications.policies.get(policy_id, \*, app_id, account_id, zone_id) -> Optional[PolicyGetResponse] #### PolicyTests diff --git a/src/cloudflare/resources/magic_transit/apps.py b/src/cloudflare/resources/magic_transit/apps.py index 6e9e59095fe..494d16ac656 100644 --- a/src/cloudflare/resources/magic_transit/apps.py +++ b/src/cloudflare/resources/magic_transit/apps.py @@ -2,14 +2,12 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast -from typing_extensions import overload +from typing import Any, List, Type, Optional, cast import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( - required_args, maybe_transform, async_maybe_transform, ) @@ -53,12 +51,14 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse: """ return AppsResourceWithStreamingResponse(self) - @overload def create( self, *, account_id: str, - body: object, + name: str, + type: str, + hostnames: List[str] | NotGiven = NOT_GIVEN, + ip_subnets: List[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, @@ -72,34 +72,13 @@ def create( Args: account_id: Identifier - extra_headers: Send extra headers + name: Display name for the app. - extra_query: Add additional query parameters to the request + type: Category of the app. - extra_body: Add additional JSON properties to the request + hostnames: FQDNs to associate with traffic decisions. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - def create( - self, - *, - account_id: str, - body: object, - # 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[AppCreateResponse]: - """ - Creates a new App for an account - - Args: - account_id: Identifier + ip_subnets: CIDRs to associate with traffic decisions. extra_headers: Send extra headers @@ -109,26 +88,19 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "body"]) - def create( - self, - *, - account_id: str, - body: object, - # 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[AppCreateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( f"/accounts/{account_id}/magic/apps", - body=maybe_transform(body, app_create_params.AppCreateParams), + body=maybe_transform( + { + "name": name, + "type": type, + "hostnames": hostnames, + "ip_subnets": ip_subnets, + }, + app_create_params.AppCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -139,77 +111,15 @@ def create( cast_to=cast(Type[Optional[AppCreateResponse]], ResultWrapper[AppCreateResponse]), ) - @overload - def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App - - Args: - account_id: Identifier - - account_app_id: Identifier - - 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 - """ - ... - - @overload - def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App - - Args: - account_id: Identifier - - account_app_id: Identifier - - 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 - """ - ... - - @overload def update( self, account_app_id: str, *, account_id: str, - body: object, + hostnames: List[str] | NotGiven = NOT_GIVEN, + ip_subnets: List[str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + type: 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, @@ -225,37 +135,13 @@ def update( account_app_id: Identifier - 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 - """ - ... + hostnames: FQDNs to associate with traffic decisions. - @overload - def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App + ip_subnets: CIDRs to associate with traffic decisions. - Args: - account_id: Identifier + name: Display name for the app. - account_app_id: Identifier + type: Category of the app. extra_headers: Send extra headers @@ -265,29 +151,21 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "body"]) - def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: raise ValueError(f"Expected a non-empty value for `account_app_id` but received {account_app_id!r}") return self._put( f"/accounts/{account_id}/magic/apps/{account_app_id}", - body=maybe_transform(body, app_update_params.AppUpdateParams), + body=maybe_transform( + { + "hostnames": hostnames, + "ip_subnets": ip_subnets, + "name": name, + "type": type, + }, + app_update_params.AppUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -399,12 +277,14 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse: """ return AsyncAppsResourceWithStreamingResponse(self) - @overload async def create( self, *, account_id: str, - body: object, + name: str, + type: str, + hostnames: List[str] | NotGiven = NOT_GIVEN, + ip_subnets: List[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, @@ -418,34 +298,13 @@ async def create( Args: account_id: Identifier - extra_headers: Send extra headers + name: Display name for the app. - extra_query: Add additional query parameters to the request + type: Category of the app. - extra_body: Add additional JSON properties to the request + hostnames: FQDNs to associate with traffic decisions. - timeout: Override the client-level default timeout for this request, in seconds - """ - ... - - @overload - async def create( - self, - *, - account_id: str, - body: object, - # 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[AppCreateResponse]: - """ - Creates a new App for an account - - Args: - account_id: Identifier + ip_subnets: CIDRs to associate with traffic decisions. extra_headers: Send extra headers @@ -455,26 +314,19 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "body"]) - async def create( - self, - *, - account_id: str, - body: object, - # 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[AppCreateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( f"/accounts/{account_id}/magic/apps", - body=await async_maybe_transform(body, app_create_params.AppCreateParams), + body=await async_maybe_transform( + { + "name": name, + "type": type, + "hostnames": hostnames, + "ip_subnets": ip_subnets, + }, + app_create_params.AppCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -485,77 +337,15 @@ async def create( cast_to=cast(Type[Optional[AppCreateResponse]], ResultWrapper[AppCreateResponse]), ) - @overload - async def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App - - Args: - account_id: Identifier - - account_app_id: Identifier - - 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 - """ - ... - - @overload - async def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App - - Args: - account_id: Identifier - - account_app_id: Identifier - - 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 - """ - ... - - @overload async def update( self, account_app_id: str, *, account_id: str, - body: object, + hostnames: List[str] | NotGiven = NOT_GIVEN, + ip_subnets: List[str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + type: 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, @@ -571,37 +361,13 @@ async def update( account_app_id: Identifier - 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 - """ - ... + hostnames: FQDNs to associate with traffic decisions. - @overload - async def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: - """ - Updates an Account App + ip_subnets: CIDRs to associate with traffic decisions. - Args: - account_id: Identifier + name: Display name for the app. - account_app_id: Identifier + type: Category of the app. extra_headers: Send extra headers @@ -611,29 +377,21 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["account_id", "body"]) - async def update( - self, - account_app_id: str, - *, - account_id: str, - body: object, - # 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[AppUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: raise ValueError(f"Expected a non-empty value for `account_app_id` but received {account_app_id!r}") return await self._put( f"/accounts/{account_id}/magic/apps/{account_app_id}", - body=await async_maybe_transform(body, app_update_params.AppUpdateParams), + body=await async_maybe_transform( + { + "hostnames": hostnames, + "ip_subnets": ip_subnets, + "name": name, + "type": type, + }, + app_update_params.AppUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py index 2568c798f90..a618e0e0124 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames/certificates.py @@ -23,8 +23,8 @@ from ....pagination import SyncSinglePage, AsyncSinglePage from ...._base_client import AsyncPaginator, make_request_options from ....types.origin_tls_client_auth.hostnames import certificate_create_params -from ....types.origin_tls_client_auth.authenticated_origin_pull import AuthenticatedOriginPull from ....types.origin_tls_client_auth.hostnames.certificate_get_response import CertificateGetResponse +from ....types.origin_tls_client_auth.hostnames.certificate_list_response import CertificateListResponse from ....types.origin_tls_client_auth.hostnames.certificate_create_response import CertificateCreateResponse from ....types.origin_tls_client_auth.hostnames.certificate_delete_response import CertificateDeleteResponse @@ -115,7 +115,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[AuthenticatedOriginPull]: + ) -> SyncSinglePage[CertificateListResponse]: """ List Certificates @@ -134,11 +134,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames/certificates", - page=SyncSinglePage[AuthenticatedOriginPull], + page=SyncSinglePage[CertificateListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AuthenticatedOriginPull, + model=CertificateListResponse, ) def delete( @@ -314,7 +314,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[AuthenticatedOriginPull, AsyncSinglePage[AuthenticatedOriginPull]]: + ) -> AsyncPaginator[CertificateListResponse, AsyncSinglePage[CertificateListResponse]]: """ List Certificates @@ -333,11 +333,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth/hostnames/certificates", - page=AsyncSinglePage[AuthenticatedOriginPull], + page=AsyncSinglePage[CertificateListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=AuthenticatedOriginPull, + model=CertificateListResponse, ) async def delete( diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index 5fc7bf53f7c..6088a88cfe0 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -39,7 +39,10 @@ AsyncHostnamesResourceWithStreamingResponse, ) from ...types.origin_tls_client_auth import origin_tls_client_auth_create_params -from ...types.origin_tls_client_auth.zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull +from ...types.origin_tls_client_auth.origin_tls_client_auth_get_response import OriginTLSClientAuthGetResponse +from ...types.origin_tls_client_auth.origin_tls_client_auth_list_response import OriginTLSClientAuthListResponse +from ...types.origin_tls_client_auth.origin_tls_client_auth_create_response import OriginTLSClientAuthCreateResponse +from ...types.origin_tls_client_auth.origin_tls_client_auth_delete_response import OriginTLSClientAuthDeleteResponse __all__ = ["OriginTLSClientAuthResource", "AsyncOriginTLSClientAuthResource"] @@ -84,7 +87,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is @@ -123,9 +126,11 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginTLSClientAuthCreateResponse]], ResultWrapper[OriginTLSClientAuthCreateResponse] ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), ) def list( @@ -138,7 +143,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ZoneAuthenticatedOriginPull]: + ) -> SyncSinglePage[OriginTLSClientAuthListResponse]: """ List Certificates @@ -157,11 +162,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth", - page=SyncSinglePage[ZoneAuthenticatedOriginPull], + page=SyncSinglePage[OriginTLSClientAuthListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZoneAuthenticatedOriginPull, + model=OriginTLSClientAuthListResponse, ) def delete( @@ -175,7 +180,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -203,9 +208,11 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginTLSClientAuthDeleteResponse]], ResultWrapper[OriginTLSClientAuthDeleteResponse] ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), ) def get( @@ -219,7 +226,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details @@ -247,9 +254,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), + cast_to=cast(Type[Optional[OriginTLSClientAuthGetResponse]], ResultWrapper[OriginTLSClientAuthGetResponse]), ) @@ -293,7 +300,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthCreateResponse]: """ Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is @@ -332,9 +339,11 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginTLSClientAuthCreateResponse]], ResultWrapper[OriginTLSClientAuthCreateResponse] ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), ) def list( @@ -347,7 +356,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ZoneAuthenticatedOriginPull, AsyncSinglePage[ZoneAuthenticatedOriginPull]]: + ) -> AsyncPaginator[OriginTLSClientAuthListResponse, AsyncSinglePage[OriginTLSClientAuthListResponse]]: """ List Certificates @@ -366,11 +375,11 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/origin_tls_client_auth", - page=AsyncSinglePage[ZoneAuthenticatedOriginPull], + page=AsyncSinglePage[OriginTLSClientAuthListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ZoneAuthenticatedOriginPull, + model=OriginTLSClientAuthListResponse, ) async def delete( @@ -384,7 +393,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ Delete Certificate @@ -412,9 +421,11 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginTLSClientAuthDeleteResponse]], ResultWrapper[OriginTLSClientAuthDeleteResponse] ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), ) async def get( @@ -428,7 +439,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ZoneAuthenticatedOriginPull]: + ) -> Optional[OriginTLSClientAuthGetResponse]: """ Get Certificate Details @@ -456,9 +467,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ZoneAuthenticatedOriginPull]]._unwrapper, + post_parser=ResultWrapper[Optional[OriginTLSClientAuthGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ZoneAuthenticatedOriginPull]], ResultWrapper[ZoneAuthenticatedOriginPull]), + cast_to=cast(Type[Optional[OriginTLSClientAuthGetResponse]], ResultWrapper[OriginTLSClientAuthGetResponse]), ) diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 3eebc7a967a..16ae47bce91 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -57,6 +57,7 @@ def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["worker"] | NotGiven = NOT_GIVEN, @@ -93,6 +94,7 @@ def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["http_pull"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -126,6 +128,7 @@ def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqWorkerConsumerSettings | consumer_create_params.MqHTTPConsumerSettings @@ -148,6 +151,7 @@ def create( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=maybe_transform( { + "dead_letter_queue": dead_letter_queue, "script_name": script_name, "settings": settings, "type": type, @@ -174,6 +178,7 @@ def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["worker"] | NotGiven = NOT_GIVEN, @@ -213,6 +218,7 @@ def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["http_pull"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -249,6 +255,7 @@ def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqWorkerConsumerSettings | consumer_update_params.MqHTTPConsumerSettings @@ -273,6 +280,7 @@ def update( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=maybe_transform( { + "dead_letter_queue": dead_letter_queue, "script_name": script_name, "settings": settings, "type": type, @@ -408,6 +416,7 @@ async def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["worker"] | NotGiven = NOT_GIVEN, @@ -444,6 +453,7 @@ async def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["http_pull"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -477,6 +487,7 @@ async def create( queue_id: str, *, account_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_create_params.MqWorkerConsumerSettings | consumer_create_params.MqHTTPConsumerSettings @@ -499,6 +510,7 @@ async def create( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=await async_maybe_transform( { + "dead_letter_queue": dead_letter_queue, "script_name": script_name, "settings": settings, "type": type, @@ -525,6 +537,7 @@ async def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqWorkerConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["worker"] | NotGiven = NOT_GIVEN, @@ -564,6 +577,7 @@ async def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqHTTPConsumerSettings | NotGiven = NOT_GIVEN, type: Literal["http_pull"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -600,6 +614,7 @@ async def update( *, account_id: str, queue_id: str, + dead_letter_queue: str | NotGiven = NOT_GIVEN, script_name: str | NotGiven = NOT_GIVEN, settings: consumer_update_params.MqWorkerConsumerSettings | consumer_update_params.MqHTTPConsumerSettings @@ -624,6 +639,7 @@ async def update( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=await async_maybe_transform( { + "dead_letter_queue": dead_letter_queue, "script_name": script_name, "settings": settings, "type": type, diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index c0350740243..6c67f33025d 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -67,6 +67,7 @@ def create( exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -104,6 +105,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -130,10 +133,11 @@ def create( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RulesetsChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RulesetsChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -170,6 +174,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -193,13 +199,14 @@ def create( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.CompressResponseRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.CompressResponseRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.CompressResponseRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.CompressionRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -236,6 +243,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -265,6 +274,7 @@ def create( exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -302,6 +312,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -328,11 +340,12 @@ def create( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RulesetsJSChallengeRuleExposedCredentialCheck + exposed_credential_check: rule_create_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RulesetsJSChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -369,6 +382,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -398,6 +413,7 @@ def create( exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.LogRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -435,6 +451,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -464,6 +482,7 @@ def create( exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -501,6 +520,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -530,6 +551,7 @@ def create( exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.RedirectRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -567,6 +589,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -596,6 +620,7 @@ def create( exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.RewriteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -633,6 +658,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -656,13 +683,14 @@ def create( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RouteRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RouteRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.OriginRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -699,6 +727,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -728,6 +758,7 @@ def create( exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ScoreRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -765,6 +796,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -794,6 +827,7 @@ def create( exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -831,6 +865,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -860,6 +896,7 @@ def create( exposed_credential_check: rule_create_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -897,6 +934,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -926,6 +965,7 @@ def create( exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SkipRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -963,6 +1003,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -992,6 +1034,7 @@ def create( exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1029,6 +1072,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1058,6 +1103,7 @@ def create( exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1095,6 +1141,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1124,6 +1172,7 @@ def create( exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1161,6 +1210,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1191,6 +1242,7 @@ def create( | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1228,6 +1280,8 @@ def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1270,11 +1324,11 @@ def create( | NotGiven = NOT_GIVEN, action_parameters: rule_create_params.BlockRuleActionParameters | object - | rule_create_params.CompressResponseRuleActionParameters + | rule_create_params.CompressionRuleActionParameters | rule_create_params.ExecuteRuleActionParameters | rule_create_params.RedirectRuleActionParameters | rule_create_params.RewriteRuleActionParameters - | rule_create_params.RouteRuleActionParameters + | rule_create_params.OriginRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters | rule_create_params.SetConfigRuleActionParameters @@ -1287,6 +1341,7 @@ def create( exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1322,6 +1377,7 @@ def create( "exposed_credential_check": exposed_credential_check, "expression": expression, "logging": logging, + "position": position, "ratelimit": ratelimit, "ref": ref, }, @@ -1415,6 +1471,7 @@ def edit( exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1452,6 +1509,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1479,10 +1538,11 @@ def edit( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RulesetsChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RulesetsChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -1519,6 +1579,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1543,13 +1605,14 @@ def edit( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.CompressResponseRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.CompressResponseRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.CompressResponseRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.CompressionRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -1586,6 +1649,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1616,6 +1681,7 @@ def edit( exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1653,6 +1719,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1680,10 +1748,11 @@ def edit( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RulesetsJSChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RulesetsJSChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -1720,6 +1789,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1750,6 +1821,7 @@ def edit( exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.LogRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1787,6 +1859,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1817,6 +1891,7 @@ def edit( exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1854,6 +1929,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1884,6 +1961,7 @@ def edit( exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.RedirectRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1921,6 +1999,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -1951,6 +2031,7 @@ def edit( exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.RewriteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1988,6 +2069,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2012,13 +2095,14 @@ def edit( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RouteRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RouteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RouteRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.OriginRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -2055,6 +2139,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2085,6 +2171,7 @@ def edit( exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ScoreRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2122,6 +2209,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2152,6 +2241,7 @@ def edit( exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2189,6 +2279,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2219,6 +2311,7 @@ def edit( exposed_credential_check: rule_edit_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2256,6 +2349,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2286,6 +2381,7 @@ def edit( exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SkipRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2323,6 +2419,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2353,6 +2451,7 @@ def edit( exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2390,6 +2489,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2420,6 +2521,7 @@ def edit( exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2457,6 +2559,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2487,6 +2591,7 @@ def edit( exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2524,6 +2629,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2555,6 +2662,7 @@ def edit( | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2592,6 +2700,8 @@ def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2636,11 +2746,11 @@ def edit( | NotGiven = NOT_GIVEN, action_parameters: rule_edit_params.BlockRuleActionParameters | object - | rule_edit_params.CompressResponseRuleActionParameters + | rule_edit_params.CompressionRuleActionParameters | rule_edit_params.ExecuteRuleActionParameters | rule_edit_params.RedirectRuleActionParameters | rule_edit_params.RewriteRuleActionParameters - | rule_edit_params.RouteRuleActionParameters + | rule_edit_params.OriginRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters | rule_edit_params.SetConfigRuleActionParameters @@ -2653,6 +2763,7 @@ def edit( exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2690,6 +2801,7 @@ def edit( "exposed_credential_check": exposed_credential_check, "expression": expression, "logging": logging, + "position": position, "ratelimit": ratelimit, "ref": ref, }, @@ -2741,6 +2853,7 @@ async def create( exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2778,6 +2891,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2804,10 +2919,11 @@ async def create( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RulesetsChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RulesetsChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -2844,6 +2960,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2867,13 +2985,14 @@ async def create( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.CompressResponseRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.CompressResponseRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.CompressResponseRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.CompressionRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -2910,6 +3029,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -2939,6 +3060,7 @@ async def create( exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2976,6 +3098,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3002,11 +3126,12 @@ async def create( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RulesetsJSChallengeRuleExposedCredentialCheck + exposed_credential_check: rule_create_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RulesetsJSChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -3043,6 +3168,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3072,6 +3199,7 @@ async def create( exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.LogRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3109,6 +3237,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3138,6 +3268,7 @@ async def create( exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3175,6 +3306,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3204,6 +3337,7 @@ async def create( exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.RedirectRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3241,6 +3375,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3270,6 +3406,7 @@ async def create( exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.RewriteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3307,6 +3444,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3330,13 +3469,14 @@ async def create( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_create_params.RouteRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_create_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_create_params.RouteRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_create_params.OriginRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_create_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -3373,6 +3513,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3402,6 +3544,7 @@ async def create( exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ScoreRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3439,6 +3582,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3468,6 +3613,7 @@ async def create( exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3505,6 +3651,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3534,6 +3682,7 @@ async def create( exposed_credential_check: rule_create_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3571,6 +3720,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3600,6 +3751,7 @@ async def create( exposed_credential_check: rule_create_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SkipRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3637,6 +3789,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3666,6 +3820,7 @@ async def create( exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3703,6 +3858,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3732,6 +3889,7 @@ async def create( exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3769,6 +3927,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3798,6 +3958,7 @@ async def create( exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3835,6 +3996,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3865,6 +4028,7 @@ async def create( | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3902,6 +4066,8 @@ async def create( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -3944,11 +4110,11 @@ async def create( | NotGiven = NOT_GIVEN, action_parameters: rule_create_params.BlockRuleActionParameters | object - | rule_create_params.CompressResponseRuleActionParameters + | rule_create_params.CompressionRuleActionParameters | rule_create_params.ExecuteRuleActionParameters | rule_create_params.RedirectRuleActionParameters | rule_create_params.RewriteRuleActionParameters - | rule_create_params.RouteRuleActionParameters + | rule_create_params.OriginRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters | rule_create_params.SetConfigRuleActionParameters @@ -3961,6 +4127,7 @@ async def create( exposed_credential_check: rule_create_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_create_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_create_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -3996,6 +4163,7 @@ async def create( "exposed_credential_check": exposed_credential_check, "expression": expression, "logging": logging, + "position": position, "ratelimit": ratelimit, "ref": ref, }, @@ -4089,6 +4257,7 @@ async def edit( exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4126,6 +4295,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4153,10 +4324,11 @@ async def edit( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RulesetsChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.ChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RulesetsChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.ChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.ChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -4193,6 +4365,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4217,13 +4391,14 @@ async def edit( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["compress_response"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.CompressResponseRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.CompressionRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.CompressResponseRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.CompressionRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.CompressResponseRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.CompressionRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.CompressionRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -4260,6 +4435,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4290,6 +4467,7 @@ async def edit( exposed_credential_check: rule_edit_params.ExecuteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ExecuteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ExecuteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4327,6 +4505,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4354,10 +4534,11 @@ async def edit( action_parameters: object | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RulesetsJSChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.JavascriptChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RulesetsJSChallengeRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.JavascriptChallengeRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.JavascriptChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -4394,6 +4575,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4424,6 +4607,7 @@ async def edit( exposed_credential_check: rule_edit_params.LogRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.LogRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.LogRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4461,6 +4645,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4491,6 +4677,7 @@ async def edit( exposed_credential_check: rule_edit_params.ManagedChallengeRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ManagedChallengeRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ManagedChallengeRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4528,6 +4715,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4558,6 +4747,7 @@ async def edit( exposed_credential_check: rule_edit_params.RedirectRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.RedirectRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.RedirectRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4595,6 +4785,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4625,6 +4817,7 @@ async def edit( exposed_credential_check: rule_edit_params.RewriteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.RewriteRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.RewriteRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4662,6 +4855,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4686,13 +4881,14 @@ async def edit( zone_id: str | NotGiven = NOT_GIVEN, id: str | NotGiven = NOT_GIVEN, action: Literal["route"] | NotGiven = NOT_GIVEN, - action_parameters: rule_edit_params.RouteRuleActionParameters | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.OriginRuleActionParameters | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, enabled: bool | NotGiven = NOT_GIVEN, - exposed_credential_check: rule_edit_params.RouteRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, + exposed_credential_check: rule_edit_params.OriginRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, - ratelimit: rule_edit_params.RouteRuleRatelimit | NotGiven = NOT_GIVEN, + position: rule_edit_params.OriginRulePosition | NotGiven = NOT_GIVEN, + ratelimit: rule_edit_params.OriginRuleRatelimit | NotGiven = NOT_GIVEN, ref: 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. @@ -4729,6 +4925,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4759,6 +4957,7 @@ async def edit( exposed_credential_check: rule_edit_params.ScoreRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ScoreRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ScoreRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4796,6 +4995,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4826,6 +5027,7 @@ async def edit( exposed_credential_check: rule_edit_params.ServeErrorRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ServeErrorRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ServeErrorRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4863,6 +5065,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4893,6 +5097,7 @@ async def edit( exposed_credential_check: rule_edit_params.SetConfigRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SetConfigRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SetConfigRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4930,6 +5135,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -4960,6 +5167,7 @@ async def edit( exposed_credential_check: rule_edit_params.SkipRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SkipRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SkipRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4997,6 +5205,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -5027,6 +5237,7 @@ async def edit( exposed_credential_check: rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.SetCacheSettingsRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.SetCacheSettingsRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -5064,6 +5275,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -5094,6 +5307,7 @@ async def edit( exposed_credential_check: rule_edit_params.LogCustomFieldRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.LogCustomFieldRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.LogCustomFieldRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -5131,6 +5345,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -5161,6 +5377,7 @@ async def edit( exposed_credential_check: rule_edit_params.DDoSDynamicRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.DDoSDynamicRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.DDoSDynamicRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -5198,6 +5415,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -5229,6 +5448,7 @@ async def edit( | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.ForceConnectionCloseRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.ForceConnectionCloseRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -5266,6 +5486,8 @@ async def edit( logging: An object configuring the rule's logging behavior. + position: An object configuring where the rule will be placed. + ratelimit: An object configuring the rule's ratelimit behavior. ref: The reference of the rule (the rule ID by default). @@ -5310,11 +5532,11 @@ async def edit( | NotGiven = NOT_GIVEN, action_parameters: rule_edit_params.BlockRuleActionParameters | object - | rule_edit_params.CompressResponseRuleActionParameters + | rule_edit_params.CompressionRuleActionParameters | rule_edit_params.ExecuteRuleActionParameters | rule_edit_params.RedirectRuleActionParameters | rule_edit_params.RewriteRuleActionParameters - | rule_edit_params.RouteRuleActionParameters + | rule_edit_params.OriginRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters | rule_edit_params.SetConfigRuleActionParameters @@ -5327,6 +5549,7 @@ async def edit( exposed_credential_check: rule_edit_params.BlockRuleExposedCredentialCheck | NotGiven = NOT_GIVEN, expression: str | NotGiven = NOT_GIVEN, logging: LoggingParam | NotGiven = NOT_GIVEN, + position: rule_edit_params.BlockRulePosition | NotGiven = NOT_GIVEN, ratelimit: rule_edit_params.BlockRuleRatelimit | NotGiven = NOT_GIVEN, ref: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -5364,6 +5587,7 @@ async def edit( "exposed_credential_check": exposed_credential_check, "expression": expression, "logging": logging, + "position": position, "ratelimit": ratelimit, "ref": ref, }, diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index f86e520cfa4..6e4dce502a2 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -23,9 +23,12 @@ from .....pagination import SyncSinglePage, AsyncSinglePage from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.access.applications import policy_create_params, policy_update_params -from .....types.zero_trust.access.application_policy import ApplicationPolicy from .....types.zero_trust.access.approval_group_param import ApprovalGroupParam +from .....types.zero_trust.access.applications.policy_get_response import PolicyGetResponse +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 __all__ = ["PoliciesResource", "AsyncPoliciesResource"] @@ -69,7 +72,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyCreateResponse]: """ Creates a policy applying exclusive to a single application that defines the users or groups who can reach it. We recommend creating a reusable policy @@ -144,9 +147,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyCreateResponse]], ResultWrapper[PolicyCreateResponse]), ) def update( @@ -169,7 +172,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyUpdateResponse]: """Updates an Access policy specific to an application. To update a reusable @@ -247,9 +250,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]), ) def list( @@ -264,7 +267,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[ApplicationPolicy]: + ) -> SyncSinglePage[PolicyListResponse]: """Lists Access policies configured for an application. Returns both exclusively @@ -301,11 +304,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/policies", - page=SyncSinglePage[ApplicationPolicy], + page=SyncSinglePage[PolicyListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ApplicationPolicy, + model=PolicyListResponse, ) def delete( @@ -385,7 +388,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyGetResponse]: """Fetches a single Access policy configured for an application. Returns both @@ -431,9 +434,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyGetResponse]], ResultWrapper[PolicyGetResponse]), ) @@ -476,7 +479,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyCreateResponse]: """ Creates a policy applying exclusive to a single application that defines the users or groups who can reach it. We recommend creating a reusable policy @@ -551,9 +554,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyCreateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyCreateResponse]], ResultWrapper[PolicyCreateResponse]), ) async def update( @@ -576,7 +579,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyUpdateResponse]: """Updates an Access policy specific to an application. To update a reusable @@ -654,9 +657,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyUpdateResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyUpdateResponse]], ResultWrapper[PolicyUpdateResponse]), ) def list( @@ -671,7 +674,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ApplicationPolicy, AsyncSinglePage[ApplicationPolicy]]: + ) -> AsyncPaginator[PolicyListResponse, AsyncSinglePage[PolicyListResponse]]: """Lists Access policies configured for an application. Returns both exclusively @@ -708,11 +711,11 @@ def list( account_or_zone_id = zone_id return self._get_api_list( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/policies", - page=AsyncSinglePage[ApplicationPolicy], + page=AsyncSinglePage[PolicyListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=ApplicationPolicy, + model=PolicyListResponse, ) async def delete( @@ -792,7 +795,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationPolicy]: + ) -> Optional[PolicyGetResponse]: """Fetches a single Access policy configured for an application. Returns both @@ -838,9 +841,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ApplicationPolicy]]._unwrapper, + post_parser=ResultWrapper[Optional[PolicyGetResponse]]._unwrapper, ), - cast_to=cast(Type[Optional[ApplicationPolicy]], ResultWrapper[ApplicationPolicy]), + cast_to=cast(Type[Optional[PolicyGetResponse]], ResultWrapper[PolicyGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py index aaaa81a5561..6cc53186ea2 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py @@ -32,6 +32,7 @@ from ......types.zero_trust.access.decision import Decision from ......types.zero_trust.access_rule_param import AccessRuleParam from ......types.zero_trust.access.applications import policy_test_create_params +from ......types.zero_trust.access.approval_group_param import ApprovalGroupParam from ......types.zero_trust.access.applications.policy_test_get_response import PolicyTestGetResponse from ......types.zero_trust.access.applications.policy_test_create_response import PolicyTestCreateResponse @@ -67,11 +68,17 @@ def create( *, account_id: str, id: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, decision: Decision | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, include: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -87,6 +94,11 @@ def create( id: The UUID of the policy + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + decision: The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action. @@ -96,11 +108,23 @@ def create( include: Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. + isolation_required: 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: The name of the Access policy. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -116,11 +140,17 @@ def create( body=maybe_transform( { "id": id, + "approval_groups": approval_groups, + "approval_required": approval_required, "decision": decision, "exclude": exclude, "include": include, + "isolation_required": isolation_required, "name": name, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_test_create_params.PolicyTestCreateParams, ), @@ -200,11 +230,17 @@ async def create( *, account_id: str, id: str | NotGiven = NOT_GIVEN, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, decision: Decision | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, include: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -220,6 +256,11 @@ async def create( id: The UUID of the policy + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + decision: The action Access will take if a user matches this policy. Infrastructure application policies can only use the Allow action. @@ -229,11 +270,23 @@ async def create( include: Rules evaluated with an OR logical operator. A user needs to meet only one of the Include rules. + isolation_required: 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: The name of the Access policy. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -249,11 +302,17 @@ async def create( body=await async_maybe_transform( { "id": id, + "approval_groups": approval_groups, + "approval_required": approval_required, "decision": decision, "exclude": exclude, "include": include, + "isolation_required": isolation_required, "name": name, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_test_create_params.PolicyTestCreateParams, ), diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index c7d215f33c2..470ba9d0d59 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -26,6 +26,7 @@ from ....types.zero_trust.access.decision import Decision from ....types.zero_trust.access_rule_param import AccessRuleParam from ....types.zero_trust.access.policy_get_response import PolicyGetResponse +from ....types.zero_trust.access.approval_group_param import ApprovalGroupParam from ....types.zero_trust.access.policy_list_response import PolicyListResponse from ....types.zero_trust.access.policy_create_response import PolicyCreateResponse from ....types.zero_trust.access.policy_delete_response import PolicyDeleteResponse @@ -61,8 +62,14 @@ def create( decision: Decision, include: Iterable[AccessRuleParam], name: str, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -84,12 +91,29 @@ def create( name: The name of the Access policy. + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. + isolation_required: 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. + + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,8 +131,14 @@ def create( "decision": decision, "include": include, "name": name, + "approval_groups": approval_groups, + "approval_required": approval_required, "exclude": exclude, + "isolation_required": isolation_required, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_create_params.PolicyCreateParams, ), @@ -130,8 +160,14 @@ def update( decision: Decision, include: Iterable[AccessRuleParam], name: str, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -155,12 +191,29 @@ def update( name: The name of the Access policy. + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. + isolation_required: 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. + + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -180,8 +233,14 @@ def update( "decision": decision, "include": include, "name": name, + "approval_groups": approval_groups, + "approval_required": approval_required, "exclude": exclude, + "isolation_required": isolation_required, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_update_params.PolicyUpdateParams, ), @@ -347,8 +406,14 @@ async def create( decision: Decision, include: Iterable[AccessRuleParam], name: str, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -370,12 +435,29 @@ async def create( name: The name of the Access policy. + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. + isolation_required: 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. + + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -393,8 +475,14 @@ async def create( "decision": decision, "include": include, "name": name, + "approval_groups": approval_groups, + "approval_required": approval_required, "exclude": exclude, + "isolation_required": isolation_required, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_create_params.PolicyCreateParams, ), @@ -416,8 +504,14 @@ async def update( decision: Decision, include: Iterable[AccessRuleParam], name: str, + approval_groups: Iterable[ApprovalGroupParam] | NotGiven = NOT_GIVEN, + approval_required: bool | NotGiven = NOT_GIVEN, exclude: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + isolation_required: bool | NotGiven = NOT_GIVEN, + purpose_justification_prompt: str | NotGiven = NOT_GIVEN, + purpose_justification_required: bool | NotGiven = NOT_GIVEN, require: Iterable[AccessRuleParam] | NotGiven = NOT_GIVEN, + session_duration: 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, @@ -441,12 +535,29 @@ async def update( name: The name of the Access policy. + approval_groups: Administrators who can approve a temporary authentication request. + + approval_required: Requires the user to request access from an administrator at the start of each + session. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. + isolation_required: 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. + + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. + + purpose_justification_required: Require users to enter a justification when they log in to the application. + require: Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. + session_duration: 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -466,8 +577,14 @@ async def update( "decision": decision, "include": include, "name": name, + "approval_groups": approval_groups, + "approval_required": approval_required, "exclude": exclude, + "isolation_required": isolation_required, + "purpose_justification_prompt": purpose_justification_prompt, + "purpose_justification_required": purpose_justification_required, "require": require, + "session_duration": session_duration, }, policy_update_params.PolicyUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/dlp/entries.py b/src/cloudflare/resources/zero_trust/dlp/entries.py index 09ee9cb37af..7a4c98b8a22 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries.py @@ -113,6 +113,7 @@ def update( name: str, pattern: PatternParam, type: Literal["custom"], + enabled: bool | 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, @@ -141,6 +142,7 @@ def update( *, account_id: str, type: Literal["predefined"], + enabled: bool | 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, @@ -169,6 +171,7 @@ def update( *, account_id: str, type: Literal["integration"], + enabled: bool | 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, @@ -199,6 +202,7 @@ def update( name: str | NotGiven = NOT_GIVEN, pattern: PatternParam | NotGiven = NOT_GIVEN, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], + enabled: bool | 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, @@ -219,6 +223,7 @@ def update( "name": name, "pattern": pattern, "type": type, + "enabled": enabled, }, entry_update_params.EntryUpdateParams, ), @@ -434,6 +439,7 @@ async def update( name: str, pattern: PatternParam, type: Literal["custom"], + enabled: bool | 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, @@ -462,6 +468,7 @@ async def update( *, account_id: str, type: Literal["predefined"], + enabled: bool | 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, @@ -490,6 +497,7 @@ async def update( *, account_id: str, type: Literal["integration"], + enabled: bool | 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, @@ -520,6 +528,7 @@ async def update( name: str | NotGiven = NOT_GIVEN, pattern: PatternParam | NotGiven = NOT_GIVEN, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], + enabled: bool | 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, @@ -540,6 +549,7 @@ async def update( "name": name, "pattern": pattern, "type": type, + "enabled": enabled, }, entry_update_params.EntryUpdateParams, ), diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py index 12af8a1b310..8c80a753b08 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py @@ -115,7 +115,6 @@ class SSL(BaseModel): """The serial number on a custom uploaded certificate.""" settings: Optional[SSLSettings] = None - """SSL specific settings.""" signature: Optional[str] = None """The signature on a custom uploaded certificate.""" @@ -198,7 +197,6 @@ class CustomHostnameCreateResponse(BaseModel): """The custom hostname that will point to your hostname via CNAME.""" ssl: SSL - """SSL properties for the custom hostname.""" created_at: Optional[datetime] = None """This is the time the hostname was created.""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py index c5113d947fc..b6e32e511ce 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py @@ -115,7 +115,6 @@ class SSL(BaseModel): """The serial number on a custom uploaded certificate.""" settings: Optional[SSLSettings] = None - """SSL specific settings.""" signature: Optional[str] = None """The signature on a custom uploaded certificate.""" @@ -198,7 +197,6 @@ class CustomHostnameEditResponse(BaseModel): """The custom hostname that will point to your hostname via CNAME.""" ssl: SSL - """SSL properties for the custom hostname.""" created_at: Optional[datetime] = None """This is the time the hostname was created.""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py index 1b418498114..8c1d1fe596d 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py @@ -115,7 +115,6 @@ class SSL(BaseModel): """The serial number on a custom uploaded certificate.""" settings: Optional[SSLSettings] = None - """SSL specific settings.""" signature: Optional[str] = None """The signature on a custom uploaded certificate.""" @@ -198,7 +197,6 @@ class CustomHostnameGetResponse(BaseModel): """The custom hostname that will point to your hostname via CNAME.""" ssl: SSL - """SSL properties for the custom hostname.""" created_at: Optional[datetime] = None """This is the time the hostname was created.""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py index 87b99e5014f..cadfd96f2b0 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py @@ -115,7 +115,6 @@ class SSL(BaseModel): """The serial number on a custom uploaded certificate.""" settings: Optional[SSLSettings] = None - """SSL specific settings.""" signature: Optional[str] = None """The signature on a custom uploaded certificate.""" @@ -198,7 +197,6 @@ class CustomHostnameListResponse(BaseModel): """The custom hostname that will point to your hostname via CNAME.""" ssl: SSL - """SSL properties for the custom hostname.""" created_at: Optional[datetime] = None """This is the time the hostname was created.""" diff --git a/src/cloudflare/types/dns/batch_patch_param.py b/src/cloudflare/types/dns/batch_patch_param.py index 5b00d937038..629ed07b76d 100644 --- a/src/cloudflare/types/dns/batch_patch_param.py +++ b/src/cloudflare/types/dns/batch_patch_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -28,10 +28,94 @@ from .dnskey_record_param import DNSKEYRecordParam from .smimea_record_param import SMIMEARecordParam -__all__ = ["BatchPatchParam", "DNSRecordsOpenpgpkeyRecord", "DNSRecordsOpenpgpkeyRecordSettings"] +__all__ = [ + "BatchPatchParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(ARecordParam): + id: Required[str] + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: Required[str] + """Identifier""" + + +class CAARecord(CAARecordParam): + id: Required[str] + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: Required[str] + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: Required[str] + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: Required[str] + """Identifier""" + + +class DSRecord(DSRecordParam): + id: Required[str] + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: Required[str] + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: Required[str] + """Identifier""" + + +class MXRecord(MXRecordParam): + id: Required[str] + """Identifier""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): +class NAPTRRecord(NAPTRRecordParam): + id: Required[str] + """Identifier""" + + +class NSRecord(NSRecordParam): + id: Required[str] + """Identifier""" + + +class OpenpgpkeyRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -49,7 +133,10 @@ class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): """ -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class OpenpgpkeyRecord(TypedDict, total=False): + id: Required[str] + """Identifier""" + comment: str """Comments or notes about the DNS record. @@ -68,7 +155,7 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings + settings: OpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -85,26 +172,66 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): """Record type.""" +class PTRRecord(PTRRecordParam): + id: Required[str] + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: Required[str] + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: Required[str] + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: Required[str] + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: Required[str] + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: Required[str] + """Identifier""" + + +class TXTRecord(TXTRecordParam): + id: Required[str] + """Identifier""" + + +class URIRecord(URIRecordParam): + id: Required[str] + """Identifier""" + + BatchPatchParam: TypeAlias = Union[ - ARecordParam, - AAAARecordParam, - CAARecordParam, - CERTRecordParam, - CNAMERecordParam, - DNSKEYRecordParam, - DSRecordParam, - HTTPSRecordParam, - LOCRecordParam, - MXRecordParam, - NAPTRRecordParam, - NSRecordParam, - DNSRecordsOpenpgpkeyRecord, - PTRRecordParam, - SMIMEARecordParam, - SRVRecordParam, - SSHFPRecordParam, - SVCBRecordParam, - TLSARecordParam, - TXTRecordParam, - URIRecordParam, + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, ] diff --git a/src/cloudflare/types/dns/batch_put_param.py b/src/cloudflare/types/dns/batch_put_param.py index 4d62eb80e9b..ea888ac7ad8 100644 --- a/src/cloudflare/types/dns/batch_put_param.py +++ b/src/cloudflare/types/dns/batch_put_param.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Union -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .ttl_param import TTLParam from .record_tags import RecordTags @@ -28,10 +28,94 @@ from .dnskey_record_param import DNSKEYRecordParam from .smimea_record_param import SMIMEARecordParam -__all__ = ["BatchPutParam", "DNSRecordsOpenpgpkeyRecord", "DNSRecordsOpenpgpkeyRecordSettings"] +__all__ = [ + "BatchPutParam", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(ARecordParam): + id: str + """Identifier""" + + +class AAAARecord(AAAARecordParam): + id: str + """Identifier""" + + +class CAARecord(CAARecordParam): + id: str + """Identifier""" + + +class CERTRecord(CERTRecordParam): + id: str + """Identifier""" + + +class CNAMERecord(CNAMERecordParam): + id: str + """Identifier""" + + +class DNSKEYRecord(DNSKEYRecordParam): + id: str + """Identifier""" -class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): +class DSRecord(DSRecordParam): + id: str + """Identifier""" + + +class HTTPSRecord(HTTPSRecordParam): + id: str + """Identifier""" + + +class LOCRecord(LOCRecordParam): + id: str + """Identifier""" + + +class MXRecord(MXRecordParam): + id: str + """Identifier""" + + +class NAPTRRecord(NAPTRRecordParam): + id: str + """Identifier""" + + +class NSRecord(NSRecordParam): + id: str + """Identifier""" + + +class OpenpgpkeyRecordSettings(TypedDict, total=False): ipv4_only: bool """ When enabled, only A records will be generated, and AAAA records will not be @@ -49,26 +133,32 @@ class DNSRecordsOpenpgpkeyRecordSettings(TypedDict, total=False): """ -class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): +class OpenpgpkeyRecord(TypedDict, total=False): + content: Required[str] + """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["OPENPGPKEY"]] + """Record type.""" + + id: str + """Identifier""" + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: str - """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - - name: str - """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: bool """ Whether the record is receiving the performance and security benefits of Cloudflare. """ - settings: DNSRecordsOpenpgpkeyRecordSettings + settings: OpenpgpkeyRecordSettings """Settings for the DNS record.""" tags: List[RecordTags] @@ -81,30 +171,67 @@ class DNSRecordsOpenpgpkeyRecord(TypedDict, total=False): minimum reduced to 30 for Enterprise zones. """ - type: Literal["OPENPGPKEY"] - """Record type.""" + +class PTRRecord(PTRRecordParam): + id: str + """Identifier""" + + +class SMIMEARecord(SMIMEARecordParam): + id: str + """Identifier""" + + +class SRVRecord(SRVRecordParam): + id: str + """Identifier""" + + +class SSHFPRecord(SSHFPRecordParam): + id: str + """Identifier""" + + +class SVCBRecord(SVCBRecordParam): + id: str + """Identifier""" + + +class TLSARecord(TLSARecordParam): + id: str + """Identifier""" + + +class TXTRecord(TXTRecordParam): + id: str + """Identifier""" + + +class URIRecord(URIRecordParam): + id: str + """Identifier""" BatchPutParam: TypeAlias = Union[ - ARecordParam, - AAAARecordParam, - CAARecordParam, - CERTRecordParam, - CNAMERecordParam, - DNSKEYRecordParam, - DSRecordParam, - HTTPSRecordParam, - LOCRecordParam, - MXRecordParam, - NAPTRRecordParam, - NSRecordParam, - DNSRecordsOpenpgpkeyRecord, - PTRRecordParam, - SMIMEARecordParam, - SRVRecordParam, - SSHFPRecordParam, - SVCBRecordParam, - TLSARecordParam, - TXTRecordParam, - URIRecordParam, + ARecord, + AAAARecord, + CAARecord, + CERTRecord, + CNAMERecord, + DNSKEYRecord, + DSRecord, + HTTPSRecord, + LOCRecord, + MXRecord, + NAPTRRecord, + NSRecord, + OpenpgpkeyRecord, + PTRRecord, + SMIMEARecord, + SRVRecord, + SSHFPRecord, + SVCBRecord, + TLSARecord, + TXTRecord, + URIRecord, ] diff --git a/src/cloudflare/types/dns/record_response.py b/src/cloudflare/types/dns/record_response.py index ab0741e7334..c86b40fed24 100644 --- a/src/cloudflare/types/dns/record_response.py +++ b/src/cloudflare/types/dns/record_response.py @@ -1,36 +1,339 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional +from datetime import datetime from typing_extensions import Literal, TypeAlias +from . import ( + a_record, + ds_record, + mx_record, + ns_record, + caa_record, + loc_record, + ptr_record, + srv_record, + txt_record, + uri_record, + aaaa_record, + cert_record, + svcb_record, + tlsa_record, + cname_record, + https_record, + naptr_record, + sshfp_record, + dnskey_record, + smimea_record, +) from .ttl import TTL -from .a_record import ARecord from ..._models import BaseModel -from .ds_record import DSRecord -from .mx_record import MXRecord -from .ns_record import NSRecord -from .caa_record import CAARecord -from .loc_record import LOCRecord -from .ptr_record import PTRRecord -from .srv_record import SRVRecord -from .txt_record import TXTRecord -from .uri_record import URIRecord -from .aaaa_record import AAAARecord -from .cert_record import CERTRecord from .record_tags import RecordTags -from .svcb_record import SVCBRecord -from .tlsa_record import TLSARecord -from .cname_record import CNAMERecord -from .https_record import HTTPSRecord -from .naptr_record import NAPTRRecord -from .sshfp_record import SSHFPRecord -from .dnskey_record import DNSKEYRecord -from .smimea_record import SMIMEARecord -__all__ = ["RecordResponse", "DNSRecordsOpenpgpkeyRecord", "DNSRecordsOpenpgpkeyRecordSettings"] +__all__ = [ + "RecordResponse", + "ARecord", + "AAAARecord", + "CAARecord", + "CERTRecord", + "CNAMERecord", + "DNSKEYRecord", + "DSRecord", + "HTTPSRecord", + "LOCRecord", + "MXRecord", + "NAPTRRecord", + "NSRecord", + "OpenpgpkeyRecord", + "OpenpgpkeyRecordSettings", + "PTRRecord", + "SMIMEARecord", + "SRVRecord", + "SSHFPRecord", + "SVCBRecord", + "TLSARecord", + "TXTRecord", + "URIRecord", +] + + +class ARecord(a_record.ARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class AAAARecord(aaaa_record.AAAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CAARecord(caa_record.CAARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CERTRecord(cert_record.CERTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class CNAMERecord(cname_record.CNAMERecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DNSKEYRecord(dnskey_record.DNSKEYRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class DSRecord(ds_record.DSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class HTTPSRecord(https_record.HTTPSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class LOCRecord(loc_record.LOCRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class MXRecord(mx_record.MXRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NAPTRRecord(naptr_record.NAPTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + meta: object + """Extra Cloudflare-specific information about the record.""" -class DNSRecordsOpenpgpkeyRecordSettings(BaseModel): + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class NSRecord(ns_record.NSRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class OpenpgpkeyRecordSettings(BaseModel): ipv4_only: Optional[bool] = None """ When enabled, only A records will be generated, and AAAA records will not be @@ -48,41 +351,246 @@ class DNSRecordsOpenpgpkeyRecordSettings(BaseModel): """ -class DNSRecordsOpenpgpkeyRecord(BaseModel): - comment: Optional[str] = None +class OpenpgpkeyRecord(BaseModel): + id: str + """Identifier""" + + comment: str """Comments or notes about the DNS record. This field has no effect on DNS responses. """ - content: Optional[str] = None + content: str """A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1)""" - name: Optional[str] = None + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + name: str """DNS record name (or @ for the zone apex) in Punycode.""" - proxied: Optional[bool] = None + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + proxied: bool """ Whether the record is receiving the performance and security benefits of Cloudflare. """ - settings: Optional[DNSRecordsOpenpgpkeyRecordSettings] = None + settings: OpenpgpkeyRecordSettings """Settings for the DNS record.""" - tags: Optional[List[RecordTags]] = None + tags: List[RecordTags] """Custom tags for the DNS record. This field has no effect on DNS responses.""" - ttl: Optional[TTL] = None + ttl: TTL """Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 for Enterprise zones. """ - type: Optional[Literal["OPENPGPKEY"]] = None + type: Literal["OPENPGPKEY"] """Record type.""" + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class PTRRecord(ptr_record.PTRRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SMIMEARecord(smimea_record.SMIMEARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SRVRecord(srv_record.SRVRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SSHFPRecord(sshfp_record.SSHFPRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class SVCBRecord(svcb_record.SVCBRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TLSARecord(tlsa_record.TLSARecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class TXTRecord(txt_record.TXTRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + + +class URIRecord(uri_record.URIRecord): + id: str + """Identifier""" + + created_on: datetime + """When the record was created.""" + + meta: object + """Extra Cloudflare-specific information about the record.""" + + modified_on: datetime + """When the record was last modified.""" + + proxiable: bool + """Whether the record can be proxied by Cloudflare or not.""" + + comment_modified_on: Optional[datetime] = None + """When the record comment was last modified. Omitted if there is no comment.""" + + tags_modified_on: Optional[datetime] = None + """When the record tags were last modified. Omitted if there are no tags.""" + RecordResponse: TypeAlias = Union[ ARecord, @@ -97,7 +605,7 @@ class DNSRecordsOpenpgpkeyRecord(BaseModel): MXRecord, NAPTRRecord, NSRecord, - DNSRecordsOpenpgpkeyRecord, + OpenpgpkeyRecord, PTRRecord, SMIMEARecord, SRVRecord, diff --git a/src/cloudflare/types/magic_transit/app_create_params.py b/src/cloudflare/types/magic_transit/app_create_params.py index 1fca0c023ee..765cb008550 100644 --- a/src/cloudflare/types/magic_transit/app_create_params.py +++ b/src/cloudflare/types/magic_transit/app_create_params.py @@ -2,24 +2,24 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypeAlias, TypedDict +from typing import List +from typing_extensions import Required, TypedDict -__all__ = ["AppCreateParams", "Hostnames", "Subnets"] +__all__ = ["AppCreateParams"] -class Hostnames(TypedDict, total=False): +class AppCreateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - body: Required[object] + name: Required[str] + """Display name for the app.""" + type: Required[str] + """Category of the app.""" -class Subnets(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - body: Required[object] - + hostnames: List[str] + """FQDNs to associate with traffic decisions.""" -AppCreateParams: TypeAlias = Union[Hostnames, Subnets] + ip_subnets: List[str] + """CIDRs to associate with traffic decisions.""" diff --git a/src/cloudflare/types/magic_transit/app_update_params.py b/src/cloudflare/types/magic_transit/app_update_params.py index ca18ed20c31..af201b87504 100644 --- a/src/cloudflare/types/magic_transit/app_update_params.py +++ b/src/cloudflare/types/magic_transit/app_update_params.py @@ -2,38 +2,24 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypeAlias, TypedDict +from typing import List +from typing_extensions import Required, TypedDict -__all__ = ["AppUpdateParams", "UpdateAppName", "UpdateAppType", "UpdateAppHostnames", "UpdateAppSubnets"] +__all__ = ["AppUpdateParams"] -class UpdateAppName(TypedDict, total=False): +class AppUpdateParams(TypedDict, total=False): account_id: Required[str] """Identifier""" - body: Required[object] + hostnames: List[str] + """FQDNs to associate with traffic decisions.""" + ip_subnets: List[str] + """CIDRs to associate with traffic decisions.""" -class UpdateAppType(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - body: Required[object] - - -class UpdateAppHostnames(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - body: Required[object] - - -class UpdateAppSubnets(TypedDict, total=False): - account_id: Required[str] - """Identifier""" - - body: Required[object] - + name: str + """Display name for the app.""" -AppUpdateParams: TypeAlias = Union[UpdateAppName, UpdateAppType, UpdateAppHostnames, UpdateAppSubnets] + type: str + """Category of the app.""" diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py index e3ec895b15d..762945a848b 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_response.py @@ -4,17 +4,7 @@ from ..._models import BaseModel -__all__ = [ - "ManagedTransformEditResponse", - "ManagedRequestHeader", - "ManagedRequestHeaderConflictsWith", - "ManagedResponseHeader", - "ManagedResponseHeaderConflictsWith", -] - - -class ManagedRequestHeaderConflictsWith: - pass +__all__ = ["ManagedTransformEditResponse", "ManagedRequestHeader", "ManagedResponseHeader"] class ManagedRequestHeader(BaseModel): @@ -30,14 +20,10 @@ class ManagedRequestHeader(BaseModel): Transforms. """ - conflicts_with: Optional[List[ManagedRequestHeaderConflictsWith]] = None + conflicts_with: Optional[List[str]] = None """The Managed Transforms that this Managed Transform conflicts with.""" -class ManagedResponseHeaderConflictsWith: - pass - - class ManagedResponseHeader(BaseModel): id: str """The human-readable identifier of the Managed Transform.""" @@ -51,7 +37,7 @@ class ManagedResponseHeader(BaseModel): Transforms. """ - conflicts_with: Optional[List[ManagedResponseHeaderConflictsWith]] = None + conflicts_with: Optional[List[str]] = None """The Managed Transforms that this Managed Transform conflicts with.""" diff --git a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py index 0d51957e2fe..c9c5f5c4af2 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_list_response.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_list_response.py @@ -4,17 +4,7 @@ from ..._models import BaseModel -__all__ = [ - "ManagedTransformListResponse", - "ManagedRequestHeader", - "ManagedRequestHeaderConflictsWith", - "ManagedResponseHeader", - "ManagedResponseHeaderConflictsWith", -] - - -class ManagedRequestHeaderConflictsWith: - pass +__all__ = ["ManagedTransformListResponse", "ManagedRequestHeader", "ManagedResponseHeader"] class ManagedRequestHeader(BaseModel): @@ -30,14 +20,10 @@ class ManagedRequestHeader(BaseModel): Transforms. """ - conflicts_with: Optional[List[ManagedRequestHeaderConflictsWith]] = None + conflicts_with: Optional[List[str]] = None """The Managed Transforms that this Managed Transform conflicts with.""" -class ManagedResponseHeaderConflictsWith: - pass - - class ManagedResponseHeader(BaseModel): id: str """The human-readable identifier of the Managed Transform.""" @@ -51,7 +37,7 @@ class ManagedResponseHeader(BaseModel): Transforms. """ - conflicts_with: Optional[List[ManagedResponseHeaderConflictsWith]] = None + conflicts_with: Optional[List[str]] = None """The Managed Transforms that this Managed Transform conflicts with.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/__init__.py b/src/cloudflare/types/origin_tls_client_auth/__init__.py index e9dd09da3fa..7f8a876de7e 100644 --- a/src/cloudflare/types/origin_tls_client_auth/__init__.py +++ b/src/cloudflare/types/origin_tls_client_auth/__init__.py @@ -9,4 +9,12 @@ from .hostname_update_response import HostnameUpdateResponse as HostnameUpdateResponse from .authenticated_origin_pull import AuthenticatedOriginPull as AuthenticatedOriginPull from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull as ZoneAuthenticatedOriginPull +from .origin_tls_client_auth_get_response import OriginTLSClientAuthGetResponse as OriginTLSClientAuthGetResponse from .origin_tls_client_auth_create_params import OriginTLSClientAuthCreateParams as OriginTLSClientAuthCreateParams +from .origin_tls_client_auth_list_response import OriginTLSClientAuthListResponse as OriginTLSClientAuthListResponse +from .origin_tls_client_auth_create_response import ( + OriginTLSClientAuthCreateResponse as OriginTLSClientAuthCreateResponse, +) +from .origin_tls_client_auth_delete_response import ( + OriginTLSClientAuthDeleteResponse as OriginTLSClientAuthDeleteResponse, +) diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py index a6b297b17d7..5c708a48cbc 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_update_response.py @@ -1,10 +1,37 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import TypeAlias from .authenticated_origin_pull import AuthenticatedOriginPull -__all__ = ["HostnameUpdateResponse"] +__all__ = ["HostnameUpdateResponse", "HostnameUpdateResponseItem"] -HostnameUpdateResponse: TypeAlias = List[AuthenticatedOriginPull] + +class HostnameUpdateResponseItem(AuthenticatedOriginPull): + id: Optional[str] = None + """Identifier""" + + cert_id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The hostname certificate.""" + + enabled: Optional[bool] = None # type: ignore + """Indicates whether hostname-level authenticated origin pulls is enabled. + + A null value voids the association. + """ + + hostname: Optional[str] = None # type: ignore + """ + The hostname on the origin for which the client certificate uploaded will be + used. + """ + + private_key: Optional[str] = None + """The hostname certificate's private key.""" + + +HostnameUpdateResponse: TypeAlias = List[HostnameUpdateResponseItem] diff --git a/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py b/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py index bdf506a1e72..edd62f82137 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostnames/__init__.py @@ -4,5 +4,6 @@ from .certificate_get_response import CertificateGetResponse as CertificateGetResponse from .certificate_create_params import CertificateCreateParams as CertificateCreateParams +from .certificate_list_response import CertificateListResponse as CertificateListResponse from .certificate_create_response import CertificateCreateResponse as CertificateCreateResponse from .certificate_delete_response import CertificateDeleteResponse as CertificateDeleteResponse diff --git a/src/cloudflare/types/origin_tls_client_auth/hostnames/certificate_list_response.py b/src/cloudflare/types/origin_tls_client_auth/hostnames/certificate_list_response.py new file mode 100644 index 00000000000..f0371b87453 --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/hostnames/certificate_list_response.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..authenticated_origin_pull import AuthenticatedOriginPull + +__all__ = ["CertificateListResponse"] + + +class CertificateListResponse(AuthenticatedOriginPull): + id: Optional[str] = None + """Identifier""" + + cert_id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The hostname certificate.""" + + enabled: Optional[bool] = None # type: ignore + """Indicates whether hostname-level authenticated origin pulls is enabled. + + A null value voids the association. + """ + + hostname: Optional[str] = None # type: ignore + """ + The hostname on the origin for which the client certificate uploaded will be + used. + """ + + private_key: Optional[str] = None + """The hostname certificate's private key.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_response.py b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_response.py new file mode 100644 index 00000000000..6cd5a6c2d3f --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull + +__all__ = ["OriginTLSClientAuthCreateResponse"] + + +class OriginTLSClientAuthCreateResponse(ZoneAuthenticatedOriginPull): + id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The zone's leaf certificate.""" + + enabled: Optional[bool] = None + """Indicates whether zone-level authenticated origin pulls is enabled.""" + + private_key: Optional[str] = None + """The zone's private key.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_delete_response.py b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_delete_response.py new file mode 100644 index 00000000000..72070aed01e --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_delete_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull + +__all__ = ["OriginTLSClientAuthDeleteResponse"] + + +class OriginTLSClientAuthDeleteResponse(ZoneAuthenticatedOriginPull): + id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The zone's leaf certificate.""" + + enabled: Optional[bool] = None + """Indicates whether zone-level authenticated origin pulls is enabled.""" + + private_key: Optional[str] = None + """The zone's private key.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_get_response.py b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_get_response.py new file mode 100644 index 00000000000..3e721673863 --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_get_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull + +__all__ = ["OriginTLSClientAuthGetResponse"] + + +class OriginTLSClientAuthGetResponse(ZoneAuthenticatedOriginPull): + id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The zone's leaf certificate.""" + + enabled: Optional[bool] = None + """Indicates whether zone-level authenticated origin pulls is enabled.""" + + private_key: Optional[str] = None + """The zone's private key.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_list_response.py b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_list_response.py new file mode 100644 index 00000000000..8920f076370 --- /dev/null +++ b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_list_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .zone_authenticated_origin_pull import ZoneAuthenticatedOriginPull + +__all__ = ["OriginTLSClientAuthListResponse"] + + +class OriginTLSClientAuthListResponse(ZoneAuthenticatedOriginPull): + id: Optional[str] = None # type: ignore + """Identifier""" + + certificate: Optional[str] = None # type: ignore + """The zone's leaf certificate.""" + + enabled: Optional[bool] = None + """Indicates whether zone-level authenticated origin pulls is enabled.""" + + private_key: Optional[str] = None + """The zone's private key.""" diff --git a/src/cloudflare/types/queues/consumer_create_params.py b/src/cloudflare/types/queues/consumer_create_params.py index 4c4f997ffb6..d3c2f29e14d 100644 --- a/src/cloudflare/types/queues/consumer_create_params.py +++ b/src/cloudflare/types/queues/consumer_create_params.py @@ -18,6 +18,8 @@ class MqWorkerConsumer(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" + dead_letter_queue: str + script_name: str """Name of a Worker""" @@ -56,6 +58,8 @@ class MqHTTPConsumer(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" + dead_letter_queue: str + settings: MqHTTPConsumerSettings type: Literal["http_pull"] diff --git a/src/cloudflare/types/queues/consumer_update_params.py b/src/cloudflare/types/queues/consumer_update_params.py index fedc18d3de1..1c75d7948f0 100644 --- a/src/cloudflare/types/queues/consumer_update_params.py +++ b/src/cloudflare/types/queues/consumer_update_params.py @@ -21,6 +21,8 @@ class MqWorkerConsumer(TypedDict, total=False): queue_id: Required[str] """A Resource identifier.""" + dead_letter_queue: str + script_name: str """Name of a Worker""" @@ -62,6 +64,8 @@ class MqHTTPConsumer(TypedDict, total=False): queue_id: Required[str] """A Resource identifier.""" + dead_letter_queue: str + settings: MqHTTPConsumerSettings type: Literal["http_pull"] diff --git a/src/cloudflare/types/rules/lists/item_get_response.py b/src/cloudflare/types/rules/lists/item_get_response.py index 16bca7d85f5..7ed243ab3ae 100644 --- a/src/cloudflare/types/rules/lists/item_get_response.py +++ b/src/cloudflare/types/rules/lists/item_get_response.py @@ -1,11 +1,84 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias from ..hostname import Hostname from ..redirect import Redirect -__all__ = ["ItemGetResponse"] +__all__ = ["ItemGetResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] -ItemGetResponse: TypeAlias = Union[str, Redirect, Hostname, int] + +class UnionMember0: + pass + + +class RulesListsRedirect(Redirect): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class RulesListsHostname(Hostname): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class UnionMember3: + pass + + +ItemGetResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rules/lists/item_list_response.py b/src/cloudflare/types/rules/lists/item_list_response.py index f49be50e1d6..21703540fd6 100644 --- a/src/cloudflare/types/rules/lists/item_list_response.py +++ b/src/cloudflare/types/rules/lists/item_list_response.py @@ -1,11 +1,84 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import TypeAlias from ..hostname import Hostname from ..redirect import Redirect -__all__ = ["ItemListResponse"] +__all__ = ["ItemListResponse", "UnionMember0", "RulesListsRedirect", "RulesListsHostname", "UnionMember3"] -ItemListResponse: TypeAlias = Union[str, Redirect, Hostname, int] + +class UnionMember0: + pass + + +class RulesListsRedirect(Redirect): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class RulesListsHostname(Hostname): + id: Optional[str] = None + """The unique ID of the list.""" + + asn: Optional[int] = None + """A non-negative 32 bit integer""" + + comment: Optional[str] = None + """An informative summary of the list item.""" + + created_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was created.""" + + hostname: Optional[Hostname] = None + """ + Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + 0 to 9, wildcards (\\**), and the hyphen (-). + """ + + ip: Optional[str] = None + """An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. + + IPv6 CIDRs are limited to a maximum of /64. + """ + + modified_on: Optional[str] = None + """The RFC 3339 timestamp of when the item was last modified.""" + + redirect: Optional[Redirect] = None + """The definition of the redirect.""" + + +class UnionMember3: + pass + + +ItemListResponse: TypeAlias = Union[UnionMember0, RulesListsRedirect, RulesListsHostname, UnionMember3] diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index eabb6ad4b32..efc9c72846f 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -15,15 +15,27 @@ "BlockRuleActionParameters", "BlockRuleActionParametersResponse", "BlockRuleExposedCredentialCheck", + "BlockRulePosition", + "BlockRulePositionBeforePosition", + "BlockRulePositionAfterPosition", + "BlockRulePositionIndexPosition", "BlockRuleRatelimit", - "RulesetsChallengeRule", - "RulesetsChallengeRuleExposedCredentialCheck", - "RulesetsChallengeRuleRatelimit", - "CompressResponseRule", - "CompressResponseRuleActionParameters", - "CompressResponseRuleActionParametersAlgorithm", - "CompressResponseRuleExposedCredentialCheck", - "CompressResponseRuleRatelimit", + "ChallengeRule", + "ChallengeRuleExposedCredentialCheck", + "ChallengeRulePosition", + "ChallengeRulePositionBeforePosition", + "ChallengeRulePositionAfterPosition", + "ChallengeRulePositionIndexPosition", + "ChallengeRuleRatelimit", + "CompressionRule", + "CompressionRuleActionParameters", + "CompressionRuleActionParametersAlgorithm", + "CompressionRuleExposedCredentialCheck", + "CompressionRulePosition", + "CompressionRulePositionBeforePosition", + "CompressionRulePositionAfterPosition", + "CompressionRulePositionIndexPosition", + "CompressionRuleRatelimit", "ExecuteRule", "ExecuteRuleActionParameters", "ExecuteRuleActionParametersMatchedData", @@ -31,15 +43,31 @@ "ExecuteRuleActionParametersOverridesCategory", "ExecuteRuleActionParametersOverridesRule", "ExecuteRuleExposedCredentialCheck", + "ExecuteRulePosition", + "ExecuteRulePositionBeforePosition", + "ExecuteRulePositionAfterPosition", + "ExecuteRulePositionIndexPosition", "ExecuteRuleRatelimit", - "RulesetsJSChallengeRule", - "RulesetsJSChallengeRuleExposedCredentialCheck", - "RulesetsJSChallengeRuleRatelimit", + "JavascriptChallengeRule", + "JavascriptChallengeRuleExposedCredentialCheck", + "JavascriptChallengeRulePosition", + "JavascriptChallengeRulePositionBeforePosition", + "JavascriptChallengeRulePositionAfterPosition", + "JavascriptChallengeRulePositionIndexPosition", + "JavascriptChallengeRuleRatelimit", "LogRule", "LogRuleExposedCredentialCheck", + "LogRulePosition", + "LogRulePositionBeforePosition", + "LogRulePositionAfterPosition", + "LogRulePositionIndexPosition", "LogRuleRatelimit", "ManagedChallengeRule", "ManagedChallengeRuleExposedCredentialCheck", + "ManagedChallengeRulePosition", + "ManagedChallengeRulePositionBeforePosition", + "ManagedChallengeRulePositionAfterPosition", + "ManagedChallengeRulePositionIndexPosition", "ManagedChallengeRuleRatelimit", "RedirectRule", "RedirectRuleActionParameters", @@ -49,6 +77,10 @@ "RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect", "RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect", "RedirectRuleExposedCredentialCheck", + "RedirectRulePosition", + "RedirectRulePositionBeforePosition", + "RedirectRulePositionAfterPosition", + "RedirectRulePositionIndexPosition", "RedirectRuleRatelimit", "RewriteRule", "RewriteRuleActionParameters", @@ -58,29 +90,53 @@ "RewriteRuleActionParametersHeadersDynamicHeader", "RewriteRuleActionParametersURI", "RewriteRuleExposedCredentialCheck", + "RewriteRulePosition", + "RewriteRulePositionBeforePosition", + "RewriteRulePositionAfterPosition", + "RewriteRulePositionIndexPosition", "RewriteRuleRatelimit", - "RouteRule", - "RouteRuleActionParameters", - "RouteRuleActionParametersOrigin", - "RouteRuleActionParametersSNI", - "RouteRuleExposedCredentialCheck", - "RouteRuleRatelimit", + "OriginRule", + "OriginRuleActionParameters", + "OriginRuleActionParametersOrigin", + "OriginRuleActionParametersSNI", + "OriginRuleExposedCredentialCheck", + "OriginRulePosition", + "OriginRulePositionBeforePosition", + "OriginRulePositionAfterPosition", + "OriginRulePositionIndexPosition", + "OriginRuleRatelimit", "ScoreRule", "ScoreRuleActionParameters", "ScoreRuleExposedCredentialCheck", + "ScoreRulePosition", + "ScoreRulePositionBeforePosition", + "ScoreRulePositionAfterPosition", + "ScoreRulePositionIndexPosition", "ScoreRuleRatelimit", "ServeErrorRule", "ServeErrorRuleActionParameters", "ServeErrorRuleExposedCredentialCheck", + "ServeErrorRulePosition", + "ServeErrorRulePositionBeforePosition", + "ServeErrorRulePositionAfterPosition", + "ServeErrorRulePositionIndexPosition", "ServeErrorRuleRatelimit", "SetConfigRule", "SetConfigRuleActionParameters", "SetConfigRuleActionParametersAutominify", "SetConfigRuleExposedCredentialCheck", + "SetConfigRulePosition", + "SetConfigRulePositionBeforePosition", + "SetConfigRulePositionAfterPosition", + "SetConfigRulePositionIndexPosition", "SetConfigRuleRatelimit", "SkipRule", "SkipRuleActionParameters", "SkipRuleExposedCredentialCheck", + "SkipRulePosition", + "SkipRulePositionBeforePosition", + "SkipRulePositionAfterPosition", + "SkipRulePositionIndexPosition", "SkipRuleRatelimit", "SetCacheSettingsRule", "SetCacheSettingsRuleActionParameters", @@ -100,6 +156,10 @@ "SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange", "SetCacheSettingsRuleActionParametersServeStale", "SetCacheSettingsRuleExposedCredentialCheck", + "SetCacheSettingsRulePosition", + "SetCacheSettingsRulePositionBeforePosition", + "SetCacheSettingsRulePositionAfterPosition", + "SetCacheSettingsRulePositionIndexPosition", "SetCacheSettingsRuleRatelimit", "LogCustomFieldRule", "LogCustomFieldRuleActionParameters", @@ -107,12 +167,24 @@ "LogCustomFieldRuleActionParametersRequestField", "LogCustomFieldRuleActionParametersResponseField", "LogCustomFieldRuleExposedCredentialCheck", + "LogCustomFieldRulePosition", + "LogCustomFieldRulePositionBeforePosition", + "LogCustomFieldRulePositionAfterPosition", + "LogCustomFieldRulePositionIndexPosition", "LogCustomFieldRuleRatelimit", "DDoSDynamicRule", "DDoSDynamicRuleExposedCredentialCheck", + "DDoSDynamicRulePosition", + "DDoSDynamicRulePositionBeforePosition", + "DDoSDynamicRulePositionAfterPosition", + "DDoSDynamicRulePositionIndexPosition", "DDoSDynamicRuleRatelimit", "ForceConnectionCloseRule", "ForceConnectionCloseRuleExposedCredentialCheck", + "ForceConnectionCloseRulePosition", + "ForceConnectionCloseRulePositionBeforePosition", + "ForceConnectionCloseRulePositionAfterPosition", + "ForceConnectionCloseRulePositionIndexPosition", "ForceConnectionCloseRuleRatelimit", ] @@ -148,6 +220,9 @@ class BlockRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: BlockRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: BlockRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -179,6 +254,32 @@ class BlockRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class BlockRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class BlockRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class BlockRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +BlockRulePosition: TypeAlias = Union[ + BlockRulePositionBeforePosition, BlockRulePositionAfterPosition, BlockRulePositionIndexPosition +] + + class BlockRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -223,7 +324,7 @@ class BlockRuleRatelimit(TypedDict, total=False): """ -class RulesetsChallengeRule(TypedDict, total=False): +class ChallengeRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -245,7 +346,7 @@ class RulesetsChallengeRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RulesetsChallengeRuleExposedCredentialCheck + exposed_credential_check: ChallengeRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -254,14 +355,17 @@ class RulesetsChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RulesetsChallengeRuleRatelimit + position: ChallengeRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: ChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): +class ChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -269,7 +373,33 @@ class RulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RulesetsChallengeRuleRatelimit(TypedDict, total=False): +class ChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ChallengeRulePosition: TypeAlias = Union[ + ChallengeRulePositionBeforePosition, ChallengeRulePositionAfterPosition, ChallengeRulePositionIndexPosition +] + + +class ChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -313,7 +443,7 @@ class RulesetsChallengeRuleRatelimit(TypedDict, total=False): """ -class CompressResponseRule(TypedDict, total=False): +class CompressionRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -326,7 +456,7 @@ class CompressResponseRule(TypedDict, total=False): action: Literal["compress_response"] """The action to perform when the rule matches.""" - action_parameters: CompressResponseRuleActionParameters + action_parameters: CompressionRuleActionParameters """The parameters configuring the rule's action.""" description: str @@ -335,7 +465,7 @@ class CompressResponseRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: CompressResponseRuleExposedCredentialCheck + exposed_credential_check: CompressionRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -344,24 +474,27 @@ class CompressResponseRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: CompressResponseRuleRatelimit + position: CompressionRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: CompressionRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class CompressResponseRuleActionParametersAlgorithm(TypedDict, total=False): +class CompressionRuleActionParametersAlgorithm(TypedDict, total=False): name: Literal["none", "auto", "default", "gzip", "brotli"] """Name of compression algorithm to enable.""" -class CompressResponseRuleActionParameters(TypedDict, total=False): - algorithms: Iterable[CompressResponseRuleActionParametersAlgorithm] +class CompressionRuleActionParameters(TypedDict, total=False): + algorithms: Iterable[CompressionRuleActionParametersAlgorithm] """Custom order for compression algorithms.""" -class CompressResponseRuleExposedCredentialCheck(TypedDict, total=False): +class CompressionRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -369,7 +502,33 @@ class CompressResponseRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class CompressResponseRuleRatelimit(TypedDict, total=False): +class CompressionRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class CompressionRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class CompressionRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +CompressionRulePosition: TypeAlias = Union[ + CompressionRulePositionBeforePosition, CompressionRulePositionAfterPosition, CompressionRulePositionIndexPosition +] + + +class CompressionRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -444,6 +603,9 @@ class ExecuteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ExecuteRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ExecuteRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -536,6 +698,32 @@ class ExecuteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ExecuteRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ExecuteRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ExecuteRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ExecuteRulePosition: TypeAlias = Union[ + ExecuteRulePositionBeforePosition, ExecuteRulePositionAfterPosition, ExecuteRulePositionIndexPosition +] + + class ExecuteRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -580,7 +768,7 @@ class ExecuteRuleRatelimit(TypedDict, total=False): """ -class RulesetsJSChallengeRule(TypedDict, total=False): +class JavascriptChallengeRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -602,7 +790,7 @@ class RulesetsJSChallengeRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RulesetsJSChallengeRuleExposedCredentialCheck + exposed_credential_check: JavascriptChallengeRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -611,14 +799,17 @@ class RulesetsJSChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RulesetsJSChallengeRuleRatelimit + position: JavascriptChallengeRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: JavascriptChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RulesetsJSChallengeRuleExposedCredentialCheck(TypedDict, total=False): +class JavascriptChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -626,7 +817,35 @@ class RulesetsJSChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RulesetsJSChallengeRuleRatelimit(TypedDict, total=False): +class JavascriptChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class JavascriptChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class JavascriptChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +JavascriptChallengeRulePosition: TypeAlias = Union[ + JavascriptChallengeRulePositionBeforePosition, + JavascriptChallengeRulePositionAfterPosition, + JavascriptChallengeRulePositionIndexPosition, +] + + +class JavascriptChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -701,6 +920,9 @@ class LogRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: LogRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: LogRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -716,6 +938,32 @@ class LogRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class LogRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class LogRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class LogRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +LogRulePosition: TypeAlias = Union[ + LogRulePositionBeforePosition, LogRulePositionAfterPosition, LogRulePositionIndexPosition +] + + class LogRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -791,6 +1039,9 @@ class ManagedChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ManagedChallengeRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ManagedChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -806,6 +1057,34 @@ class ManagedChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ManagedChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ManagedChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ManagedChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ManagedChallengeRulePosition: TypeAlias = Union[ + ManagedChallengeRulePositionBeforePosition, + ManagedChallengeRulePositionAfterPosition, + ManagedChallengeRulePositionIndexPosition, +] + + class ManagedChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -881,6 +1160,9 @@ class RedirectRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: RedirectRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: RedirectRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -939,6 +1221,32 @@ class RedirectRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class RedirectRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class RedirectRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class RedirectRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +RedirectRulePosition: TypeAlias = Union[ + RedirectRulePositionBeforePosition, RedirectRulePositionAfterPosition, RedirectRulePositionIndexPosition +] + + class RedirectRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1014,6 +1322,9 @@ class RewriteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: RewriteRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: RewriteRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1070,6 +1381,32 @@ class RewriteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class RewriteRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class RewriteRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class RewriteRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +RewriteRulePosition: TypeAlias = Union[ + RewriteRulePositionBeforePosition, RewriteRulePositionAfterPosition, RewriteRulePositionIndexPosition +] + + class RewriteRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1114,7 +1451,7 @@ class RewriteRuleRatelimit(TypedDict, total=False): """ -class RouteRule(TypedDict, total=False): +class OriginRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -1127,7 +1464,7 @@ class RouteRule(TypedDict, total=False): action: Literal["route"] """The action to perform when the rule matches.""" - action_parameters: RouteRuleActionParameters + action_parameters: OriginRuleActionParameters """The parameters configuring the rule's action.""" description: str @@ -1136,7 +1473,7 @@ class RouteRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RouteRuleExposedCredentialCheck + exposed_credential_check: OriginRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -1145,14 +1482,17 @@ class RouteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RouteRuleRatelimit + position: OriginRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: OriginRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RouteRuleActionParametersOrigin(TypedDict, total=False): +class OriginRuleActionParametersOrigin(TypedDict, total=False): host: str """Override the resolved hostname.""" @@ -1160,23 +1500,23 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False): """Override the destination port.""" -class RouteRuleActionParametersSNI(TypedDict, total=False): +class OriginRuleActionParametersSNI(TypedDict, total=False): value: Required[str] """The SNI override.""" -class RouteRuleActionParameters(TypedDict, total=False): +class OriginRuleActionParameters(TypedDict, total=False): host_header: str """Rewrite the HTTP Host header.""" - origin: RouteRuleActionParametersOrigin + origin: OriginRuleActionParametersOrigin """Override the IP/TCP destination.""" - sni: RouteRuleActionParametersSNI + sni: OriginRuleActionParametersSNI """Override the Server Name Indication (SNI).""" -class RouteRuleExposedCredentialCheck(TypedDict, total=False): +class OriginRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -1184,7 +1524,33 @@ class RouteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RouteRuleRatelimit(TypedDict, total=False): +class OriginRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class OriginRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class OriginRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +OriginRulePosition: TypeAlias = Union[ + OriginRulePositionBeforePosition, OriginRulePositionAfterPosition, OriginRulePositionIndexPosition +] + + +class OriginRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -1259,6 +1625,9 @@ class ScoreRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ScoreRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ScoreRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1282,6 +1651,32 @@ class ScoreRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ScoreRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ScoreRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ScoreRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ScoreRulePosition: TypeAlias = Union[ + ScoreRulePositionBeforePosition, ScoreRulePositionAfterPosition, ScoreRulePositionIndexPosition +] + + class ScoreRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1357,6 +1752,9 @@ class ServeErrorRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ServeErrorRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ServeErrorRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1383,6 +1781,32 @@ class ServeErrorRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ServeErrorRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ServeErrorRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ServeErrorRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ServeErrorRulePosition: TypeAlias = Union[ + ServeErrorRulePositionBeforePosition, ServeErrorRulePositionAfterPosition, ServeErrorRulePositionIndexPosition +] + + class ServeErrorRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1458,6 +1882,9 @@ class SetConfigRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SetConfigRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SetConfigRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1537,6 +1964,32 @@ class SetConfigRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SetConfigRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetConfigRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetConfigRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetConfigRulePosition: TypeAlias = Union[ + SetConfigRulePositionBeforePosition, SetConfigRulePositionAfterPosition, SetConfigRulePositionIndexPosition +] + + class SetConfigRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1612,6 +2065,9 @@ class SkipRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SkipRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SkipRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1656,6 +2112,32 @@ class SkipRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SkipRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SkipRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SkipRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SkipRulePosition: TypeAlias = Union[ + SkipRulePositionBeforePosition, SkipRulePositionAfterPosition, SkipRulePositionIndexPosition +] + + class SkipRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1731,6 +2213,9 @@ class SetCacheSettingsRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SetCacheSettingsRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SetCacheSettingsRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2019,6 +2504,34 @@ class SetCacheSettingsRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SetCacheSettingsRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheSettingsRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheSettingsRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheSettingsRulePosition: TypeAlias = Union[ + SetCacheSettingsRulePositionBeforePosition, + SetCacheSettingsRulePositionAfterPosition, + SetCacheSettingsRulePositionIndexPosition, +] + + class SetCacheSettingsRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2094,6 +2607,9 @@ class LogCustomFieldRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: LogCustomFieldRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: LogCustomFieldRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2135,6 +2651,34 @@ class LogCustomFieldRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class LogCustomFieldRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class LogCustomFieldRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class LogCustomFieldRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +LogCustomFieldRulePosition: TypeAlias = Union[ + LogCustomFieldRulePositionBeforePosition, + LogCustomFieldRulePositionAfterPosition, + LogCustomFieldRulePositionIndexPosition, +] + + class LogCustomFieldRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2210,6 +2754,9 @@ class DDoSDynamicRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: DDoSDynamicRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: DDoSDynamicRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2225,6 +2772,32 @@ class DDoSDynamicRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class DDoSDynamicRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class DDoSDynamicRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class DDoSDynamicRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +DDoSDynamicRulePosition: TypeAlias = Union[ + DDoSDynamicRulePositionBeforePosition, DDoSDynamicRulePositionAfterPosition, DDoSDynamicRulePositionIndexPosition +] + + class DDoSDynamicRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2300,6 +2873,9 @@ class ForceConnectionCloseRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ForceConnectionCloseRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ForceConnectionCloseRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2315,6 +2891,34 @@ class ForceConnectionCloseRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ForceConnectionCloseRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ForceConnectionCloseRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ForceConnectionCloseRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ForceConnectionCloseRulePosition: TypeAlias = Union[ + ForceConnectionCloseRulePositionBeforePosition, + ForceConnectionCloseRulePositionAfterPosition, + ForceConnectionCloseRulePositionIndexPosition, +] + + class ForceConnectionCloseRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2361,15 +2965,15 @@ class ForceConnectionCloseRuleRatelimit(TypedDict, total=False): RuleCreateParams: TypeAlias = Union[ BlockRule, - RulesetsChallengeRule, - CompressResponseRule, + ChallengeRule, + CompressionRule, ExecuteRule, - RulesetsJSChallengeRule, + JavascriptChallengeRule, LogRule, ManagedChallengeRule, RedirectRule, RewriteRule, - RouteRule, + OriginRule, ScoreRule, ServeErrorRule, SetConfigRule, diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 51b1e35ef67..201bf84f5b3 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -15,15 +15,27 @@ "BlockRuleActionParameters", "BlockRuleActionParametersResponse", "BlockRuleExposedCredentialCheck", + "BlockRulePosition", + "BlockRulePositionBeforePosition", + "BlockRulePositionAfterPosition", + "BlockRulePositionIndexPosition", "BlockRuleRatelimit", - "RulesetsChallengeRule", - "RulesetsChallengeRuleExposedCredentialCheck", - "RulesetsChallengeRuleRatelimit", - "CompressResponseRule", - "CompressResponseRuleActionParameters", - "CompressResponseRuleActionParametersAlgorithm", - "CompressResponseRuleExposedCredentialCheck", - "CompressResponseRuleRatelimit", + "ChallengeRule", + "ChallengeRuleExposedCredentialCheck", + "ChallengeRulePosition", + "ChallengeRulePositionBeforePosition", + "ChallengeRulePositionAfterPosition", + "ChallengeRulePositionIndexPosition", + "ChallengeRuleRatelimit", + "CompressionRule", + "CompressionRuleActionParameters", + "CompressionRuleActionParametersAlgorithm", + "CompressionRuleExposedCredentialCheck", + "CompressionRulePosition", + "CompressionRulePositionBeforePosition", + "CompressionRulePositionAfterPosition", + "CompressionRulePositionIndexPosition", + "CompressionRuleRatelimit", "ExecuteRule", "ExecuteRuleActionParameters", "ExecuteRuleActionParametersMatchedData", @@ -31,15 +43,31 @@ "ExecuteRuleActionParametersOverridesCategory", "ExecuteRuleActionParametersOverridesRule", "ExecuteRuleExposedCredentialCheck", + "ExecuteRulePosition", + "ExecuteRulePositionBeforePosition", + "ExecuteRulePositionAfterPosition", + "ExecuteRulePositionIndexPosition", "ExecuteRuleRatelimit", - "RulesetsJSChallengeRule", - "RulesetsJSChallengeRuleExposedCredentialCheck", - "RulesetsJSChallengeRuleRatelimit", + "JavascriptChallengeRule", + "JavascriptChallengeRuleExposedCredentialCheck", + "JavascriptChallengeRulePosition", + "JavascriptChallengeRulePositionBeforePosition", + "JavascriptChallengeRulePositionAfterPosition", + "JavascriptChallengeRulePositionIndexPosition", + "JavascriptChallengeRuleRatelimit", "LogRule", "LogRuleExposedCredentialCheck", + "LogRulePosition", + "LogRulePositionBeforePosition", + "LogRulePositionAfterPosition", + "LogRulePositionIndexPosition", "LogRuleRatelimit", "ManagedChallengeRule", "ManagedChallengeRuleExposedCredentialCheck", + "ManagedChallengeRulePosition", + "ManagedChallengeRulePositionBeforePosition", + "ManagedChallengeRulePositionAfterPosition", + "ManagedChallengeRulePositionIndexPosition", "ManagedChallengeRuleRatelimit", "RedirectRule", "RedirectRuleActionParameters", @@ -49,6 +77,10 @@ "RedirectRuleActionParametersFromValueTargetURLStaticURLRedirect", "RedirectRuleActionParametersFromValueTargetURLDynamicURLRedirect", "RedirectRuleExposedCredentialCheck", + "RedirectRulePosition", + "RedirectRulePositionBeforePosition", + "RedirectRulePositionAfterPosition", + "RedirectRulePositionIndexPosition", "RedirectRuleRatelimit", "RewriteRule", "RewriteRuleActionParameters", @@ -58,29 +90,53 @@ "RewriteRuleActionParametersHeadersDynamicHeader", "RewriteRuleActionParametersURI", "RewriteRuleExposedCredentialCheck", + "RewriteRulePosition", + "RewriteRulePositionBeforePosition", + "RewriteRulePositionAfterPosition", + "RewriteRulePositionIndexPosition", "RewriteRuleRatelimit", - "RouteRule", - "RouteRuleActionParameters", - "RouteRuleActionParametersOrigin", - "RouteRuleActionParametersSNI", - "RouteRuleExposedCredentialCheck", - "RouteRuleRatelimit", + "OriginRule", + "OriginRuleActionParameters", + "OriginRuleActionParametersOrigin", + "OriginRuleActionParametersSNI", + "OriginRuleExposedCredentialCheck", + "OriginRulePosition", + "OriginRulePositionBeforePosition", + "OriginRulePositionAfterPosition", + "OriginRulePositionIndexPosition", + "OriginRuleRatelimit", "ScoreRule", "ScoreRuleActionParameters", "ScoreRuleExposedCredentialCheck", + "ScoreRulePosition", + "ScoreRulePositionBeforePosition", + "ScoreRulePositionAfterPosition", + "ScoreRulePositionIndexPosition", "ScoreRuleRatelimit", "ServeErrorRule", "ServeErrorRuleActionParameters", "ServeErrorRuleExposedCredentialCheck", + "ServeErrorRulePosition", + "ServeErrorRulePositionBeforePosition", + "ServeErrorRulePositionAfterPosition", + "ServeErrorRulePositionIndexPosition", "ServeErrorRuleRatelimit", "SetConfigRule", "SetConfigRuleActionParameters", "SetConfigRuleActionParametersAutominify", "SetConfigRuleExposedCredentialCheck", + "SetConfigRulePosition", + "SetConfigRulePositionBeforePosition", + "SetConfigRulePositionAfterPosition", + "SetConfigRulePositionIndexPosition", "SetConfigRuleRatelimit", "SkipRule", "SkipRuleActionParameters", "SkipRuleExposedCredentialCheck", + "SkipRulePosition", + "SkipRulePositionBeforePosition", + "SkipRulePositionAfterPosition", + "SkipRulePositionIndexPosition", "SkipRuleRatelimit", "SetCacheSettingsRule", "SetCacheSettingsRuleActionParameters", @@ -100,6 +156,10 @@ "SetCacheSettingsRuleActionParametersEdgeTTLStatusCodeTTLStatusCodeRange", "SetCacheSettingsRuleActionParametersServeStale", "SetCacheSettingsRuleExposedCredentialCheck", + "SetCacheSettingsRulePosition", + "SetCacheSettingsRulePositionBeforePosition", + "SetCacheSettingsRulePositionAfterPosition", + "SetCacheSettingsRulePositionIndexPosition", "SetCacheSettingsRuleRatelimit", "LogCustomFieldRule", "LogCustomFieldRuleActionParameters", @@ -107,12 +167,24 @@ "LogCustomFieldRuleActionParametersRequestField", "LogCustomFieldRuleActionParametersResponseField", "LogCustomFieldRuleExposedCredentialCheck", + "LogCustomFieldRulePosition", + "LogCustomFieldRulePositionBeforePosition", + "LogCustomFieldRulePositionAfterPosition", + "LogCustomFieldRulePositionIndexPosition", "LogCustomFieldRuleRatelimit", "DDoSDynamicRule", "DDoSDynamicRuleExposedCredentialCheck", + "DDoSDynamicRulePosition", + "DDoSDynamicRulePositionBeforePosition", + "DDoSDynamicRulePositionAfterPosition", + "DDoSDynamicRulePositionIndexPosition", "DDoSDynamicRuleRatelimit", "ForceConnectionCloseRule", "ForceConnectionCloseRuleExposedCredentialCheck", + "ForceConnectionCloseRulePosition", + "ForceConnectionCloseRulePositionBeforePosition", + "ForceConnectionCloseRulePositionAfterPosition", + "ForceConnectionCloseRulePositionIndexPosition", "ForceConnectionCloseRuleRatelimit", ] @@ -151,6 +223,9 @@ class BlockRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: BlockRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: BlockRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -182,6 +257,32 @@ class BlockRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class BlockRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class BlockRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class BlockRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +BlockRulePosition: TypeAlias = Union[ + BlockRulePositionBeforePosition, BlockRulePositionAfterPosition, BlockRulePositionIndexPosition +] + + class BlockRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -226,7 +327,7 @@ class BlockRuleRatelimit(TypedDict, total=False): """ -class RulesetsChallengeRule(TypedDict, total=False): +class ChallengeRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -251,7 +352,7 @@ class RulesetsChallengeRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RulesetsChallengeRuleExposedCredentialCheck + exposed_credential_check: ChallengeRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -260,14 +361,17 @@ class RulesetsChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RulesetsChallengeRuleRatelimit + position: ChallengeRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: ChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): +class ChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -275,7 +379,33 @@ class RulesetsChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RulesetsChallengeRuleRatelimit(TypedDict, total=False): +class ChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ChallengeRulePosition: TypeAlias = Union[ + ChallengeRulePositionBeforePosition, ChallengeRulePositionAfterPosition, ChallengeRulePositionIndexPosition +] + + +class ChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -319,7 +449,7 @@ class RulesetsChallengeRuleRatelimit(TypedDict, total=False): """ -class CompressResponseRule(TypedDict, total=False): +class CompressionRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -335,7 +465,7 @@ class CompressResponseRule(TypedDict, total=False): action: Literal["compress_response"] """The action to perform when the rule matches.""" - action_parameters: CompressResponseRuleActionParameters + action_parameters: CompressionRuleActionParameters """The parameters configuring the rule's action.""" description: str @@ -344,7 +474,7 @@ class CompressResponseRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: CompressResponseRuleExposedCredentialCheck + exposed_credential_check: CompressionRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -353,24 +483,27 @@ class CompressResponseRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: CompressResponseRuleRatelimit + position: CompressionRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: CompressionRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class CompressResponseRuleActionParametersAlgorithm(TypedDict, total=False): +class CompressionRuleActionParametersAlgorithm(TypedDict, total=False): name: Literal["none", "auto", "default", "gzip", "brotli"] """Name of compression algorithm to enable.""" -class CompressResponseRuleActionParameters(TypedDict, total=False): - algorithms: Iterable[CompressResponseRuleActionParametersAlgorithm] +class CompressionRuleActionParameters(TypedDict, total=False): + algorithms: Iterable[CompressionRuleActionParametersAlgorithm] """Custom order for compression algorithms.""" -class CompressResponseRuleExposedCredentialCheck(TypedDict, total=False): +class CompressionRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -378,7 +511,33 @@ class CompressResponseRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class CompressResponseRuleRatelimit(TypedDict, total=False): +class CompressionRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class CompressionRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class CompressionRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +CompressionRulePosition: TypeAlias = Union[ + CompressionRulePositionBeforePosition, CompressionRulePositionAfterPosition, CompressionRulePositionIndexPosition +] + + +class CompressionRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -456,6 +615,9 @@ class ExecuteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ExecuteRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ExecuteRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -548,6 +710,32 @@ class ExecuteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ExecuteRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ExecuteRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ExecuteRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ExecuteRulePosition: TypeAlias = Union[ + ExecuteRulePositionBeforePosition, ExecuteRulePositionAfterPosition, ExecuteRulePositionIndexPosition +] + + class ExecuteRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -592,7 +780,7 @@ class ExecuteRuleRatelimit(TypedDict, total=False): """ -class RulesetsJSChallengeRule(TypedDict, total=False): +class JavascriptChallengeRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -617,7 +805,7 @@ class RulesetsJSChallengeRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RulesetsJSChallengeRuleExposedCredentialCheck + exposed_credential_check: JavascriptChallengeRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -626,14 +814,17 @@ class RulesetsJSChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RulesetsJSChallengeRuleRatelimit + position: JavascriptChallengeRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: JavascriptChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RulesetsJSChallengeRuleExposedCredentialCheck(TypedDict, total=False): +class JavascriptChallengeRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -641,7 +832,35 @@ class RulesetsJSChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RulesetsJSChallengeRuleRatelimit(TypedDict, total=False): +class JavascriptChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class JavascriptChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class JavascriptChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +JavascriptChallengeRulePosition: TypeAlias = Union[ + JavascriptChallengeRulePositionBeforePosition, + JavascriptChallengeRulePositionAfterPosition, + JavascriptChallengeRulePositionIndexPosition, +] + + +class JavascriptChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -719,6 +938,9 @@ class LogRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: LogRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: LogRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -734,6 +956,32 @@ class LogRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class LogRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class LogRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class LogRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +LogRulePosition: TypeAlias = Union[ + LogRulePositionBeforePosition, LogRulePositionAfterPosition, LogRulePositionIndexPosition +] + + class LogRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -812,6 +1060,9 @@ class ManagedChallengeRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ManagedChallengeRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ManagedChallengeRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -827,6 +1078,34 @@ class ManagedChallengeRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ManagedChallengeRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ManagedChallengeRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ManagedChallengeRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ManagedChallengeRulePosition: TypeAlias = Union[ + ManagedChallengeRulePositionBeforePosition, + ManagedChallengeRulePositionAfterPosition, + ManagedChallengeRulePositionIndexPosition, +] + + class ManagedChallengeRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -905,6 +1184,9 @@ class RedirectRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: RedirectRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: RedirectRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -963,6 +1245,32 @@ class RedirectRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class RedirectRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class RedirectRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class RedirectRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +RedirectRulePosition: TypeAlias = Union[ + RedirectRulePositionBeforePosition, RedirectRulePositionAfterPosition, RedirectRulePositionIndexPosition +] + + class RedirectRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1041,6 +1349,9 @@ class RewriteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: RewriteRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: RewriteRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1097,6 +1408,32 @@ class RewriteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class RewriteRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class RewriteRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class RewriteRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +RewriteRulePosition: TypeAlias = Union[ + RewriteRulePositionBeforePosition, RewriteRulePositionAfterPosition, RewriteRulePositionIndexPosition +] + + class RewriteRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1141,7 +1478,7 @@ class RewriteRuleRatelimit(TypedDict, total=False): """ -class RouteRule(TypedDict, total=False): +class OriginRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -1157,7 +1494,7 @@ class RouteRule(TypedDict, total=False): action: Literal["route"] """The action to perform when the rule matches.""" - action_parameters: RouteRuleActionParameters + action_parameters: OriginRuleActionParameters """The parameters configuring the rule's action.""" description: str @@ -1166,7 +1503,7 @@ class RouteRule(TypedDict, total=False): enabled: bool """Whether the rule should be executed.""" - exposed_credential_check: RouteRuleExposedCredentialCheck + exposed_credential_check: OriginRuleExposedCredentialCheck """Configure checks for exposed credentials.""" expression: str @@ -1175,14 +1512,17 @@ class RouteRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" - ratelimit: RouteRuleRatelimit + position: OriginRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: OriginRuleRatelimit """An object configuring the rule's ratelimit behavior.""" ref: str """The reference of the rule (the rule ID by default).""" -class RouteRuleActionParametersOrigin(TypedDict, total=False): +class OriginRuleActionParametersOrigin(TypedDict, total=False): host: str """Override the resolved hostname.""" @@ -1190,23 +1530,23 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False): """Override the destination port.""" -class RouteRuleActionParametersSNI(TypedDict, total=False): +class OriginRuleActionParametersSNI(TypedDict, total=False): value: Required[str] """The SNI override.""" -class RouteRuleActionParameters(TypedDict, total=False): +class OriginRuleActionParameters(TypedDict, total=False): host_header: str """Rewrite the HTTP Host header.""" - origin: RouteRuleActionParametersOrigin + origin: OriginRuleActionParametersOrigin """Override the IP/TCP destination.""" - sni: RouteRuleActionParametersSNI + sni: OriginRuleActionParametersSNI """Override the Server Name Indication (SNI).""" -class RouteRuleExposedCredentialCheck(TypedDict, total=False): +class OriginRuleExposedCredentialCheck(TypedDict, total=False): password_expression: Required[str] """Expression that selects the password used in the credentials check.""" @@ -1214,7 +1554,33 @@ class RouteRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" -class RouteRuleRatelimit(TypedDict, total=False): +class OriginRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class OriginRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class OriginRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +OriginRulePosition: TypeAlias = Union[ + OriginRulePositionBeforePosition, OriginRulePositionAfterPosition, OriginRulePositionIndexPosition +] + + +class OriginRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ Characteristics of the request on which the ratelimiter counter will be @@ -1292,6 +1658,9 @@ class ScoreRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ScoreRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ScoreRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1315,6 +1684,32 @@ class ScoreRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ScoreRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ScoreRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ScoreRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ScoreRulePosition: TypeAlias = Union[ + ScoreRulePositionBeforePosition, ScoreRulePositionAfterPosition, ScoreRulePositionIndexPosition +] + + class ScoreRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1393,6 +1788,9 @@ class ServeErrorRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ServeErrorRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ServeErrorRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1419,6 +1817,32 @@ class ServeErrorRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ServeErrorRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ServeErrorRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ServeErrorRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ServeErrorRulePosition: TypeAlias = Union[ + ServeErrorRulePositionBeforePosition, ServeErrorRulePositionAfterPosition, ServeErrorRulePositionIndexPosition +] + + class ServeErrorRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1497,6 +1921,9 @@ class SetConfigRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SetConfigRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SetConfigRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1576,6 +2003,32 @@ class SetConfigRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SetConfigRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetConfigRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetConfigRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetConfigRulePosition: TypeAlias = Union[ + SetConfigRulePositionBeforePosition, SetConfigRulePositionAfterPosition, SetConfigRulePositionIndexPosition +] + + class SetConfigRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1654,6 +2107,9 @@ class SkipRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SkipRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SkipRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -1698,6 +2154,32 @@ class SkipRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SkipRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SkipRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SkipRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SkipRulePosition: TypeAlias = Union[ + SkipRulePositionBeforePosition, SkipRulePositionAfterPosition, SkipRulePositionIndexPosition +] + + class SkipRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -1776,6 +2258,9 @@ class SetCacheSettingsRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: SetCacheSettingsRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: SetCacheSettingsRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2064,6 +2549,34 @@ class SetCacheSettingsRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class SetCacheSettingsRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheSettingsRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheSettingsRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheSettingsRulePosition: TypeAlias = Union[ + SetCacheSettingsRulePositionBeforePosition, + SetCacheSettingsRulePositionAfterPosition, + SetCacheSettingsRulePositionIndexPosition, +] + + class SetCacheSettingsRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2142,6 +2655,9 @@ class LogCustomFieldRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: LogCustomFieldRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: LogCustomFieldRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2183,6 +2699,34 @@ class LogCustomFieldRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class LogCustomFieldRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class LogCustomFieldRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class LogCustomFieldRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +LogCustomFieldRulePosition: TypeAlias = Union[ + LogCustomFieldRulePositionBeforePosition, + LogCustomFieldRulePositionAfterPosition, + LogCustomFieldRulePositionIndexPosition, +] + + class LogCustomFieldRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2261,6 +2805,9 @@ class DDoSDynamicRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: DDoSDynamicRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: DDoSDynamicRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2276,6 +2823,32 @@ class DDoSDynamicRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class DDoSDynamicRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class DDoSDynamicRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class DDoSDynamicRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +DDoSDynamicRulePosition: TypeAlias = Union[ + DDoSDynamicRulePositionBeforePosition, DDoSDynamicRulePositionAfterPosition, DDoSDynamicRulePositionIndexPosition +] + + class DDoSDynamicRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2354,6 +2927,9 @@ class ForceConnectionCloseRule(TypedDict, total=False): logging: LoggingParam """An object configuring the rule's logging behavior.""" + position: ForceConnectionCloseRulePosition + """An object configuring where the rule will be placed.""" + ratelimit: ForceConnectionCloseRuleRatelimit """An object configuring the rule's ratelimit behavior.""" @@ -2369,6 +2945,34 @@ class ForceConnectionCloseRuleExposedCredentialCheck(TypedDict, total=False): """Expression that selects the user ID used in the credentials check.""" +class ForceConnectionCloseRulePositionBeforePosition(TypedDict, total=False): + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class ForceConnectionCloseRulePositionAfterPosition(TypedDict, total=False): + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class ForceConnectionCloseRulePositionIndexPosition(TypedDict, total=False): + index: float + """An index at which to place the rule, where index 1 is the first rule.""" + + +ForceConnectionCloseRulePosition: TypeAlias = Union[ + ForceConnectionCloseRulePositionBeforePosition, + ForceConnectionCloseRulePositionAfterPosition, + ForceConnectionCloseRulePositionIndexPosition, +] + + class ForceConnectionCloseRuleRatelimit(TypedDict, total=False): characteristics: Required[List[str]] """ @@ -2415,15 +3019,15 @@ class ForceConnectionCloseRuleRatelimit(TypedDict, total=False): RuleEditParams: TypeAlias = Union[ BlockRule, - RulesetsChallengeRule, - CompressResponseRule, + ChallengeRule, + CompressionRule, ExecuteRule, - RulesetsJSChallengeRule, + JavascriptChallengeRule, LogRule, ManagedChallengeRule, RedirectRule, RewriteRule, - RouteRule, + OriginRule, ScoreRule, ServeErrorRule, SetConfigRule, diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index e5debe2e745..3db17eae160 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -14,6 +14,7 @@ from .oidc_saas_app import OIDCSaaSApp as OIDCSaaSApp from .saml_saas_app import SAMLSaaSApp as SAMLSaaSApp from .service_token import ServiceToken as ServiceToken +from .approval_group import ApprovalGroup as ApprovalGroup from .allowed_headers import AllowedHeaders as AllowedHeaders from .allowed_methods import AllowedMethods as AllowedMethods from .allowed_origins import AllowedOrigins as AllowedOrigins diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 335b4de1b69..54c921e854c 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -103,6 +103,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", ] @@ -2077,6 +2079,22 @@ class InfrastructureApplicationTargetCriterion(TypedDict, total=False): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(TypedDict, total=False): + usernames: Required[List[str]] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: bool + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(TypedDict, total=False): + ssh: InfrastructureApplicationPolicyConnectionRulesSSH + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(TypedDict, total=False): decision: Required[Decision] """The action Access will take if a user matches this policy. @@ -2093,6 +2111,12 @@ class InfrastructureApplicationPolicy(TypedDict, total=False): name: Required[str] """The name of the Access policy.""" + connection_rules: InfrastructureApplicationPolicyConnectionRules + """ + The rules that define how users may connect to the targets secured by your + application. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 9fe984fb2b4..cc4872de0c6 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -23,12 +23,14 @@ "ApplicationCreateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", + "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -37,6 +39,7 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -44,6 +47,7 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -52,6 +56,7 @@ "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", + "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -60,6 +65,7 @@ "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", + "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -68,6 +74,7 @@ "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", + "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -82,6 +89,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -104,6 +113,14 @@ class SelfHostedApplicationDestination(BaseModel): """ +class SelfHostedApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -293,7 +310,7 @@ class SelfHostedApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SelfHostedApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -337,6 +354,14 @@ class SelfHostedApplication(BaseModel): updated_at: Optional[datetime] = None +class SaaSApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] @@ -460,7 +485,7 @@ class SaaSApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SaaSApplicationPolicy]] = None saas_app: Optional[SaaSApplicationSaaSApp] = None @@ -496,6 +521,14 @@ class BrowserSSHApplicationDestination(BaseModel): """ +class BrowserSSHApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -685,7 +718,7 @@ class BrowserSSHApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserSSHApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -743,6 +776,14 @@ class BrowserVNCApplicationDestination(BaseModel): """ +class BrowserVNCApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -932,7 +973,7 @@ class BrowserVNCApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserVNCApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -1001,6 +1042,14 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -1136,7 +1185,7 @@ class AppLauncherApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[AppLauncherApplicationPolicy]] = None scim_config: Optional[AppLauncherApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1182,6 +1231,14 @@ class DeviceEnrollmentPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1319,7 +1376,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[DeviceEnrollmentPermissionsApplicationPolicy]] = None scim_config: Optional[DeviceEnrollmentPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1365,6 +1422,14 @@ class BrowserIsolationPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1502,7 +1567,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserIsolationPermissionsApplicationPolicy]] = None scim_config: Optional[BrowserIsolationPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1661,10 +1726,32 @@ class InfrastructureApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(BaseModel): + usernames: List[str] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: Optional[bool] = None + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(BaseModel): + ssh: Optional[InfrastructureApplicationPolicyConnectionRulesSSH] = None + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" + connection_rules: Optional[InfrastructureApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to the targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 1e2031d1264..602389f778c 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -23,12 +23,14 @@ "ApplicationGetResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", + "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -37,6 +39,7 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -44,6 +47,7 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -52,6 +56,7 @@ "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", + "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -60,6 +65,7 @@ "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", + "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -68,6 +74,7 @@ "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", + "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -82,6 +89,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -104,6 +113,14 @@ class SelfHostedApplicationDestination(BaseModel): """ +class SelfHostedApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -293,7 +310,7 @@ class SelfHostedApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SelfHostedApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -337,6 +354,14 @@ class SelfHostedApplication(BaseModel): updated_at: Optional[datetime] = None +class SaaSApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] @@ -460,7 +485,7 @@ class SaaSApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SaaSApplicationPolicy]] = None saas_app: Optional[SaaSApplicationSaaSApp] = None @@ -496,6 +521,14 @@ class BrowserSSHApplicationDestination(BaseModel): """ +class BrowserSSHApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -685,7 +718,7 @@ class BrowserSSHApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserSSHApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -743,6 +776,14 @@ class BrowserVNCApplicationDestination(BaseModel): """ +class BrowserVNCApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -932,7 +973,7 @@ class BrowserVNCApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserVNCApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -1001,6 +1042,14 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -1136,7 +1185,7 @@ class AppLauncherApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[AppLauncherApplicationPolicy]] = None scim_config: Optional[AppLauncherApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1182,6 +1231,14 @@ class DeviceEnrollmentPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1319,7 +1376,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[DeviceEnrollmentPermissionsApplicationPolicy]] = None scim_config: Optional[DeviceEnrollmentPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1365,6 +1422,14 @@ class BrowserIsolationPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1502,7 +1567,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserIsolationPermissionsApplicationPolicy]] = None scim_config: Optional[BrowserIsolationPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1661,10 +1726,32 @@ class InfrastructureApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(BaseModel): + usernames: List[str] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: Optional[bool] = None + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(BaseModel): + ssh: Optional[InfrastructureApplicationPolicyConnectionRulesSSH] = None + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" + connection_rules: Optional[InfrastructureApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to the targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 9a4ff2becdd..b39efa41ff7 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -23,12 +23,14 @@ "ApplicationListResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", + "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -37,6 +39,7 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -44,6 +47,7 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -52,6 +56,7 @@ "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", + "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -60,6 +65,7 @@ "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", + "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -68,6 +74,7 @@ "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", + "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -82,6 +89,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -104,6 +113,14 @@ class SelfHostedApplicationDestination(BaseModel): """ +class SelfHostedApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -293,7 +310,7 @@ class SelfHostedApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SelfHostedApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -337,6 +354,14 @@ class SelfHostedApplication(BaseModel): updated_at: Optional[datetime] = None +class SaaSApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] @@ -460,7 +485,7 @@ class SaaSApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SaaSApplicationPolicy]] = None saas_app: Optional[SaaSApplicationSaaSApp] = None @@ -496,6 +521,14 @@ class BrowserSSHApplicationDestination(BaseModel): """ +class BrowserSSHApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -685,7 +718,7 @@ class BrowserSSHApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserSSHApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -743,6 +776,14 @@ class BrowserVNCApplicationDestination(BaseModel): """ +class BrowserVNCApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -932,7 +973,7 @@ class BrowserVNCApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserVNCApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -1001,6 +1042,14 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -1136,7 +1185,7 @@ class AppLauncherApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[AppLauncherApplicationPolicy]] = None scim_config: Optional[AppLauncherApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1182,6 +1231,14 @@ class DeviceEnrollmentPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1319,7 +1376,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[DeviceEnrollmentPermissionsApplicationPolicy]] = None scim_config: Optional[DeviceEnrollmentPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1365,6 +1422,14 @@ class BrowserIsolationPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1502,7 +1567,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserIsolationPermissionsApplicationPolicy]] = None scim_config: Optional[BrowserIsolationPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1661,10 +1726,32 @@ class InfrastructureApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(BaseModel): + usernames: List[str] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: Optional[bool] = None + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(BaseModel): + ssh: Optional[InfrastructureApplicationPolicyConnectionRulesSSH] = None + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" + connection_rules: Optional[InfrastructureApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to the targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_policy.py b/src/cloudflare/types/zero_trust/access/application_policy.py index 35e359680fd..fee16109e49 100644 --- a/src/cloudflare/types/zero_trust/access/application_policy.py +++ b/src/cloudflare/types/zero_trust/access/application_policy.py @@ -6,6 +6,7 @@ from .decision import Decision from ...._models import BaseModel from ..access_rule import AccessRule +from .approval_group import ApprovalGroup __all__ = ["ApplicationPolicy"] @@ -14,6 +15,15 @@ class ApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" + 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 @@ -34,13 +44,33 @@ class ApplicationPolicy(BaseModel): 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 diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 160b8896c7d..a9bbaf36695 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -103,6 +103,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", ] @@ -2077,6 +2079,22 @@ class InfrastructureApplicationTargetCriterion(TypedDict, total=False): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(TypedDict, total=False): + usernames: Required[List[str]] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: bool + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(TypedDict, total=False): + ssh: InfrastructureApplicationPolicyConnectionRulesSSH + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(TypedDict, total=False): decision: Required[Decision] """The action Access will take if a user matches this policy. @@ -2093,6 +2111,12 @@ class InfrastructureApplicationPolicy(TypedDict, total=False): name: Required[str] """The name of the Access policy.""" + connection_rules: InfrastructureApplicationPolicyConnectionRules + """ + The rules that define how users may connect to the targets secured by your + application. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index a9f905cbe71..f6b0efdd7fd 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -23,12 +23,14 @@ "ApplicationUpdateResponse", "SelfHostedApplication", "SelfHostedApplicationDestination", + "SelfHostedApplicationPolicy", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", + "SaaSApplicationPolicy", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -37,6 +39,7 @@ "SaaSApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserSSHApplication", "BrowserSSHApplicationDestination", + "BrowserSSHApplicationPolicy", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -44,6 +47,7 @@ "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserVNCApplication", "BrowserVNCApplicationDestination", + "BrowserVNCApplicationPolicy", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -52,6 +56,7 @@ "AppLauncherApplication", "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", + "AppLauncherApplicationPolicy", "AppLauncherApplicationSCIMConfig", "AppLauncherApplicationSCIMConfigAuthentication", "AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -60,6 +65,7 @@ "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationFooterLink", "DeviceEnrollmentPermissionsApplicationLandingPageDesign", + "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationSCIMConfig", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthentication", "DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -68,6 +74,7 @@ "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationFooterLink", "BrowserIsolationPermissionsApplicationLandingPageDesign", + "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationSCIMConfig", "BrowserIsolationPermissionsApplicationSCIMConfigAuthentication", "BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -82,6 +89,8 @@ "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", + "InfrastructureApplicationPolicyConnectionRules", + "InfrastructureApplicationPolicyConnectionRulesSSH", "InfrastructureApplicationSCIMConfig", "InfrastructureApplicationSCIMConfigAuthentication", "InfrastructureApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -104,6 +113,14 @@ class SelfHostedApplicationDestination(BaseModel): """ +class SelfHostedApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -293,7 +310,7 @@ class SelfHostedApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SelfHostedApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -337,6 +354,14 @@ class SelfHostedApplication(BaseModel): updated_at: Optional[datetime] = None +class SaaSApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + SaaSApplicationSaaSApp: TypeAlias = Union[SAMLSaaSApp, OIDCSaaSApp] @@ -460,7 +485,7 @@ class SaaSApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[SaaSApplicationPolicy]] = None saas_app: Optional[SaaSApplicationSaaSApp] = None @@ -496,6 +521,14 @@ class BrowserSSHApplicationDestination(BaseModel): """ +class BrowserSSHApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -685,7 +718,7 @@ class BrowserSSHApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserSSHApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -743,6 +776,14 @@ class BrowserVNCApplicationDestination(BaseModel): """ +class BrowserVNCApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -932,7 +973,7 @@ class BrowserVNCApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserVNCApplicationPolicy]] = None same_site_cookie_attribute: Optional[str] = None """ @@ -1001,6 +1042,14 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class AppLauncherApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): client_id: str """ @@ -1136,7 +1185,7 @@ class AppLauncherApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[AppLauncherApplicationPolicy]] = None scim_config: Optional[AppLauncherApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1182,6 +1231,14 @@ class DeviceEnrollmentPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class DeviceEnrollmentPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1319,7 +1376,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[DeviceEnrollmentPermissionsApplicationPolicy]] = None scim_config: Optional[DeviceEnrollmentPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1365,6 +1422,14 @@ class BrowserIsolationPermissionsApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class BrowserIsolationPermissionsApplicationPolicy(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + class BrowserIsolationPermissionsApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): @@ -1502,7 +1567,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): name: Optional[str] = None """The name of the application.""" - policies: Optional[List[ApplicationPolicy]] = None + policies: Optional[List[BrowserIsolationPermissionsApplicationPolicy]] = None scim_config: Optional[BrowserIsolationPermissionsApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. @@ -1661,10 +1726,32 @@ class InfrastructureApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" +class InfrastructureApplicationPolicyConnectionRulesSSH(BaseModel): + usernames: List[str] + """Contains the Unix usernames that may be used when connecting over SSH.""" + + allow_email_alias: Optional[bool] = None + """Enables using Identity Provider email alias as SSH username.""" + + +class InfrastructureApplicationPolicyConnectionRules(BaseModel): + ssh: Optional[InfrastructureApplicationPolicyConnectionRulesSSH] = None + """ + The SSH-specific rules that define how users may connect to the targets secured + by your application. + """ + + class InfrastructureApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" + connection_rules: Optional[InfrastructureApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to the targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/applications/__init__.py b/src/cloudflare/types/zero_trust/access/applications/__init__.py index 0945146512b..362c1906e85 100644 --- a/src/cloudflare/types/zero_trust/access/applications/__init__.py +++ b/src/cloudflare/types/zero_trust/access/applications/__init__.py @@ -4,10 +4,14 @@ from .ca import CA as CA from .ca_delete_response import CADeleteResponse as CADeleteResponse +from .policy_get_response import PolicyGetResponse as PolicyGetResponse 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 from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse +from .policy_update_response import PolicyUpdateResponse as PolicyUpdateResponse from .policy_test_get_response import PolicyTestGetResponse as PolicyTestGetResponse from .policy_test_create_params import PolicyTestCreateParams as PolicyTestCreateParams from .policy_test_create_response import PolicyTestCreateResponse as PolicyTestCreateResponse diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py new file mode 100644 index 00000000000..179e888a378 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..application_policy import ApplicationPolicy + +__all__ = ["PolicyCreateResponse"] + + +class PolicyCreateResponse(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py new file mode 100644 index 00000000000..10d2aa6090c --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..application_policy import ApplicationPolicy + +__all__ = ["PolicyGetResponse"] + + +class PolicyGetResponse(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py new file mode 100644 index 00000000000..43d3385fcab --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..application_policy import ApplicationPolicy + +__all__ = ["PolicyListResponse"] + + +class PolicyListResponse(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py index 6dfcb5fbb88..b1e7593389d 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py @@ -7,6 +7,7 @@ from ..decision import Decision from ...access_rule_param import AccessRuleParam +from ..approval_group_param import ApprovalGroupParam __all__ = ["PolicyTestCreateParams"] @@ -18,6 +19,15 @@ class PolicyTestCreateParams(TypedDict, total=False): id: str """The UUID of the policy""" + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + decision: Decision """The action Access will take if a user matches this policy. @@ -36,11 +46,31 @@ class PolicyTestCreateParams(TypedDict, total=False): A user needs to meet only one of the Include rules. """ + isolation_required: bool + """ + 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: str """The name of the Access policy.""" + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. """ + + session_duration: str + """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. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py new file mode 100644 index 00000000000..63bfdeb0c3f --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..application_policy import ApplicationPolicy + +__all__ = ["PolicyUpdateResponse"] + + +class PolicyUpdateResponse(ApplicationPolicy): + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ diff --git a/src/cloudflare/types/zero_trust/access/approval_group.py b/src/cloudflare/types/zero_trust/access/approval_group.py new file mode 100644 index 00000000000..f6000d965f3 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/approval_group.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel + +__all__ = ["ApprovalGroup"] + + +class ApprovalGroup(BaseModel): + approvals_needed: float + """The number of approvals needed to obtain access.""" + + email_addresses: Optional[List[str]] = None + """A list of emails that can approve the access request.""" + + email_list_uuid: Optional[str] = None + """The UUID of an re-usable email list.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index 109bfe8f7da..921fd57b6a2 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -7,6 +7,7 @@ from .decision import Decision from ..access_rule_param import AccessRuleParam +from .approval_group_param import ApprovalGroupParam __all__ = ["PolicyCreateParams"] @@ -30,14 +31,43 @@ class PolicyCreateParams(TypedDict, total=False): name: Required[str] """The name of the Access policy.""" + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. """ + isolation_required: bool + """ + 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. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. """ + + session_duration: str + """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. + """ diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index 4e037a6219f..680cc7cd07b 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -2,10 +2,12 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from .decision import Decision from ...._models import BaseModel from ..access_rule import AccessRule +from .approval_group import ApprovalGroup __all__ = ["PolicyCreateResponse"] @@ -14,6 +16,18 @@ class PolicyCreateResponse(BaseModel): id: Optional[str] = None """The UUID of the policy""" + app_count: Optional[int] = None + """Number of access applications currently using this policy.""" + + 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 @@ -34,13 +48,35 @@ class PolicyCreateResponse(BaseModel): 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. """ + reusable: Optional[Literal[True]] = None + + 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 diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index 480f83d1b52..bfa6be1d5d5 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -2,10 +2,12 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from .decision import Decision from ...._models import BaseModel from ..access_rule import AccessRule +from .approval_group import ApprovalGroup __all__ = ["PolicyGetResponse"] @@ -14,6 +16,18 @@ class PolicyGetResponse(BaseModel): id: Optional[str] = None """The UUID of the policy""" + app_count: Optional[int] = None + """Number of access applications currently using this policy.""" + + 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 @@ -34,13 +48,35 @@ class PolicyGetResponse(BaseModel): 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. """ + reusable: Optional[Literal[True]] = None + + 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 diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index 889e760032c..f32b6f0eee3 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -2,10 +2,12 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from .decision import Decision from ...._models import BaseModel from ..access_rule import AccessRule +from .approval_group import ApprovalGroup __all__ = ["PolicyListResponse"] @@ -14,6 +16,18 @@ class PolicyListResponse(BaseModel): id: Optional[str] = None """The UUID of the policy""" + app_count: Optional[int] = None + """Number of access applications currently using this policy.""" + + 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 @@ -34,13 +48,35 @@ class PolicyListResponse(BaseModel): 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. """ + reusable: Optional[Literal[True]] = None + + 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 diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 903f4b16bf0..8ec4bdd1c26 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -7,6 +7,7 @@ from .decision import Decision from ..access_rule_param import AccessRuleParam +from .approval_group_param import ApprovalGroupParam __all__ = ["PolicyUpdateParams"] @@ -30,14 +31,43 @@ class PolicyUpdateParams(TypedDict, total=False): name: Required[str] """The name of the Access policy.""" + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. """ + isolation_required: bool + """ + 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. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + require: Iterable[AccessRuleParam] """Rules evaluated with an AND logical operator. To match the policy, a user must meet all of the Require rules. """ + + session_duration: str + """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. + """ diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index 053d0230559..4e15ccbb683 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -2,10 +2,12 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from .decision import Decision from ...._models import BaseModel from ..access_rule import AccessRule +from .approval_group import ApprovalGroup __all__ = ["PolicyUpdateResponse"] @@ -14,6 +16,18 @@ class PolicyUpdateResponse(BaseModel): id: Optional[str] = None """The UUID of the policy""" + app_count: Optional[int] = None + """Number of access applications currently using this policy.""" + + 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 @@ -34,13 +48,35 @@ class PolicyUpdateResponse(BaseModel): 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. """ + reusable: Optional[Literal[True]] = None + + 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 diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py index 2caba23715c..7fc8706ca1e 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py @@ -19,17 +19,23 @@ class Variant0(TypedDict, total=False): type: Required[Literal["custom"]] + enabled: bool + class Variant1(TypedDict, total=False): account_id: Required[str] type: Required[Literal["predefined"]] + enabled: bool + class Variant2(TypedDict, total=False): account_id: Required[str] type: Required[Literal["integration"]] + enabled: bool + EntryUpdateParams: TypeAlias = Union[Variant0, Variant1, Variant2] diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index 48df60e80c7..4f4e76cc76d 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -3118,6 +3118,7 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], posts=[ @@ -3148,6 +3149,7 @@ def test_method_batch_with_all_params(self, client: Cloudflare) -> None: "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], ) @@ -8053,6 +8055,7 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], posts=[ @@ -8083,6 +8086,7 @@ async def test_method_batch_with_all_params(self, async_client: AsyncCloudflare) "tags": ["owner:dns-team"], "ttl": 3600, "type": "A", + "id": "023e105f4ecef8ad9ca31a8372d0c353", } ], ) diff --git a/tests/api_resources/magic_transit/test_apps.py b/tests/api_resources/magic_transit/test_apps.py index 7a2bea638d1..47dcbbf87ac 100644 --- a/tests/api_resources/magic_transit/test_apps.py +++ b/tests/api_resources/magic_transit/test_apps.py @@ -27,10 +27,11 @@ class TestApps: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_method_create_overload_1(self, client: Cloudflare) -> None: + def test_method_create(self, client: Cloudflare) -> None: app = client.magic_transit.apps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -38,53 +39,13 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: - response = client.magic_transit.apps.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = response.parse() - assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: - with client.magic_transit.apps.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = response.parse() - assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_path_params_create_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.apps.with_raw_response.create( - account_id="", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_method_create_overload_2(self, client: Cloudflare) -> None: + def test_method_create_with_all_params(self, client: Cloudflare) -> None: app = client.magic_transit.apps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", + hostnames=["auth.cloudflare.com"], + ip_subnets=["1.1.1.1/32"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -92,10 +53,11 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + def test_raw_response_create(self, client: Cloudflare) -> None: response = client.magic_transit.apps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) assert response.is_closed is True @@ -107,10 +69,11 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + def test_streaming_response_create(self, client: Cloudflare) -> None: with client.magic_transit.apps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -124,87 +87,22 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.magic_transit.apps.with_raw_response.create( account_id="", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_method_update_overload_1(self, client: Cloudflare) -> None: - app = client.magic_transit.apps.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: - response = client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: - with client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) @pytest.mark.skip( reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_method_update_overload_2(self, client: Cloudflare) -> None: + def test_method_update(self, client: Cloudflare) -> None: app = client.magic_transit.apps.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -212,129 +110,14 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: - response = client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: - with client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_method_update_overload_3(self, client: Cloudflare) -> None: - app = client.magic_transit.apps.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: - response = client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: - with client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_path_params_update_overload_3(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - def test_method_update_overload_4(self, client: Cloudflare) -> None: + def test_method_update_with_all_params(self, client: Cloudflare) -> None: app = client.magic_transit.apps.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + hostnames=["auth.cloudflare.com"], + ip_subnets=["1.1.1.1/32"], + name="Cloudflare Dashboard", + type="Development", ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -342,11 +125,10 @@ def test_method_update_overload_4(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + def test_raw_response_update(self, client: Cloudflare) -> None: response = client.magic_transit.apps.with_raw_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) assert response.is_closed is True @@ -358,11 +140,10 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: + def test_streaming_response_update(self, client: Cloudflare) -> None: with client.magic_transit.apps.with_streaming_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -376,19 +157,17 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - def test_path_params_update_overload_4(self, client: Cloudflare) -> None: + def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.magic_transit.apps.with_raw_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): client.magic_transit.apps.with_raw_response.update( account_app_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) @pytest.mark.skip( @@ -497,10 +276,11 @@ class TestAsyncApps: reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_create(self, async_client: AsyncCloudflare) -> None: app = await async_client.magic_transit.apps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -508,53 +288,13 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.apps.with_raw_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = await response.parse() - assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.apps.with_streaming_response.create( - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = await response.parse() - assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.create( - account_id="", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: app = await async_client.magic_transit.apps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", + hostnames=["auth.cloudflare.com"], + ip_subnets=["1.1.1.1/32"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -562,10 +302,11 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.apps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) assert response.is_closed is True @@ -577,10 +318,11 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.apps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -594,87 +336,22 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.magic_transit.apps.with_raw_response.create( account_id="", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: - app = await async_client.magic_transit.apps.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + name="Cloudflare Dashboard", + type="Development", ) @pytest.mark.skip( reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_method_update(self, async_client: AsyncCloudflare) -> None: app = await async_client.magic_transit.apps.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -682,129 +359,14 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: - app = await async_client.magic_transit.apps.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: - response = await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: - async with async_client.magic_transit.apps.with_streaming_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - app = await response.parse() - assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_path_params_update_overload_3(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="023e105f4ecef8ad9ca31a8372d0c353", - account_id="", - body={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): - await async_client.magic_transit.apps.with_raw_response.update( - account_app_id="", - account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, - ) - - @pytest.mark.skip( - reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" - ) - @parametrize - async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: app = await async_client.magic_transit.apps.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, + hostnames=["auth.cloudflare.com"], + ip_subnets=["1.1.1.1/32"], + name="Cloudflare Dashboard", + type="Development", ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -812,11 +374,10 @@ async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.magic_transit.apps.with_raw_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) assert response.is_closed is True @@ -828,11 +389,10 @@ async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflar reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_streaming_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.magic_transit.apps.with_streaming_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -846,19 +406,17 @@ async def test_streaming_response_update_overload_4(self, async_client: AsyncClo reason="prism errors - https://github.com/cloudflare/cloudflare-python/actions/runs/9360388260/job/25765690361?pr=482#step:5:7212" ) @parametrize - async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.magic_transit.apps.with_raw_response.update( account_app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_app_id` but received ''"): await async_client.magic_transit.apps.with_raw_response.update( account_app_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={}, ) @pytest.mark.skip( diff --git a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py index ccaf45b9b4e..0e2ef562a10 100644 --- a/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py +++ b/tests/api_resources/origin_tls_client_auth/hostnames/test_certificates.py @@ -10,9 +10,9 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.origin_tls_client_auth import AuthenticatedOriginPull from cloudflare.types.origin_tls_client_auth.hostnames import ( CertificateGetResponse, + CertificateListResponse, CertificateCreateResponse, CertificateDeleteResponse, ) @@ -74,7 +74,7 @@ def test_method_list(self, client: Cloudflare) -> None: certificate = client.origin_tls_client_auth.hostnames.certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateListResponse], certificate, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -85,7 +85,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateListResponse], certificate, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -96,7 +96,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = response.parse() - assert_matches_type(SyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(SyncSinglePage[CertificateListResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True @@ -258,7 +258,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: certificate = await async_client.origin_tls_client_auth.hostnames.certificates.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateListResponse], certificate, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -269,7 +269,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateListResponse], certificate, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -280,7 +280,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate = await response.parse() - assert_matches_type(AsyncSinglePage[AuthenticatedOriginPull], certificate, path=["response"]) + assert_matches_type(AsyncSinglePage[CertificateListResponse], certificate, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index 650240c0262..b566b540ad7 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", script_name="my-consumer-worker", settings={ "batch_size": 50, @@ -99,6 +100,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_retries": 3, @@ -164,6 +166,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", script_name="my-consumer-worker", settings={ "batch_size": 50, @@ -242,6 +245,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_retries": 3, @@ -428,6 +432,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", script_name="my-consumer-worker", settings={ "batch_size": 50, @@ -493,6 +498,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_retries": 3, @@ -558,6 +564,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", script_name="my-consumer-worker", settings={ "batch_size": 50, @@ -636,6 +643,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_retries": 3, diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index d8d0c847379..117eee8c295 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -53,6 +53,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -142,6 +143,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -231,6 +233,7 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -345,6 +348,7 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -434,6 +438,7 @@ def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -523,6 +528,7 @@ def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -612,6 +618,7 @@ def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -711,6 +718,7 @@ def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -811,6 +819,7 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -907,6 +916,7 @@ def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -996,6 +1006,7 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1089,6 +1100,7 @@ def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1200,6 +1212,7 @@ def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1295,6 +1308,7 @@ def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1447,6 +1461,7 @@ def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1540,6 +1555,7 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1629,6 +1645,7 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1718,6 +1735,7 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1896,6 +1914,7 @@ def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -1999,6 +2018,7 @@ def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2102,6 +2122,7 @@ def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2230,6 +2251,7 @@ def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2333,6 +2355,7 @@ def test_method_edit_with_all_params_overload_5(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2436,6 +2459,7 @@ def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2539,6 +2563,7 @@ def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2652,6 +2677,7 @@ def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2766,6 +2792,7 @@ def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> Non }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2876,6 +2903,7 @@ def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -2979,6 +3007,7 @@ def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3086,6 +3115,7 @@ def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3211,6 +3241,7 @@ def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3320,6 +3351,7 @@ def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3486,6 +3518,7 @@ def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3593,6 +3626,7 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3696,6 +3730,7 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3799,6 +3834,7 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3910,6 +3946,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -3999,6 +4036,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4088,6 +4126,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4202,6 +4241,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4291,6 +4331,7 @@ async def test_method_create_with_all_params_overload_5(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4380,6 +4421,7 @@ async def test_method_create_with_all_params_overload_6(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4469,6 +4511,7 @@ async def test_method_create_with_all_params_overload_7(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4568,6 +4611,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4668,6 +4712,7 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4764,6 +4809,7 @@ async def test_method_create_with_all_params_overload_10(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4853,6 +4899,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -4946,6 +4993,7 @@ async def test_method_create_with_all_params_overload_12(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5057,6 +5105,7 @@ async def test_method_create_with_all_params_overload_13(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5152,6 +5201,7 @@ async def test_method_create_with_all_params_overload_14(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5304,6 +5354,7 @@ async def test_method_create_with_all_params_overload_15(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5397,6 +5448,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5486,6 +5538,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5575,6 +5628,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5753,6 +5807,7 @@ async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5856,6 +5911,7 @@ async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -5959,6 +6015,7 @@ async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6087,6 +6144,7 @@ async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6190,6 +6248,7 @@ async def test_method_edit_with_all_params_overload_5(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6293,6 +6352,7 @@ async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6396,6 +6456,7 @@ async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6509,6 +6570,7 @@ async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6623,6 +6685,7 @@ async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncC }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6733,6 +6796,7 @@ async def test_method_edit_with_all_params_overload_10(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6836,6 +6900,7 @@ async def test_method_edit_with_all_params_overload_11(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -6943,6 +7008,7 @@ async def test_method_edit_with_all_params_overload_12(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7068,6 +7134,7 @@ async def test_method_edit_with_all_params_overload_13(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7177,6 +7244,7 @@ async def test_method_edit_with_all_params_overload_14(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7343,6 +7411,7 @@ async def test_method_edit_with_all_params_overload_15(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7450,6 +7519,7 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7553,6 +7623,7 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, @@ -7656,6 +7727,7 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async }, expression="ip.src ne 1.1.1.1", logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, ratelimit={ "characteristics": ["ip.src"], "period": 10, diff --git a/tests/api_resources/test_origin_tls_client_auth.py b/tests/api_resources/test_origin_tls_client_auth.py index 082f3cdabb5..fc28c9cbee6 100644 --- a/tests/api_resources/test_origin_tls_client_auth.py +++ b/tests/api_resources/test_origin_tls_client_auth.py @@ -10,7 +10,12 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.origin_tls_client_auth import ZoneAuthenticatedOriginPull +from cloudflare.types.origin_tls_client_auth import ( + OriginTLSClientAuthGetResponse, + OriginTLSClientAuthListResponse, + OriginTLSClientAuthCreateResponse, + OriginTLSClientAuthDeleteResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +30,7 @@ def test_method_create(self, client: Cloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -38,7 +43,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -51,7 +56,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -69,7 +74,7 @@ def test_method_list(self, client: Cloudflare) -> None: origin_tls_client_auth = client.origin_tls_client_auth.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -80,7 +85,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -91,7 +96,9 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(SyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type( + SyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -108,7 +115,7 @@ def test_method_delete(self, client: Cloudflare) -> None: certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -120,7 +127,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -132,7 +139,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -156,7 +163,7 @@ def test_method_get(self, client: Cloudflare) -> None: certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -168,7 +175,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -180,7 +187,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -209,7 +216,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -222,7 +229,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -235,7 +242,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthCreateResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -253,7 +260,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: origin_tls_client_auth = await async_client.origin_tls_client_auth.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -264,7 +271,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -275,7 +282,9 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(AsyncSinglePage[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type( + AsyncSinglePage[OriginTLSClientAuthListResponse], origin_tls_client_auth, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -292,7 +301,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -304,7 +313,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -316,7 +325,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthDeleteResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,7 +349,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -352,7 +361,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -364,7 +373,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" origin_tls_client_auth = await response.parse() - assert_matches_type(Optional[ZoneAuthenticatedOriginPull], origin_tls_client_auth, path=["response"]) + assert_matches_type(Optional[OriginTLSClientAuthGetResponse], origin_tls_client_auth, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index d2b129cdad2..de3dd7c1c8c 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -10,9 +10,12 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.access import ApplicationPolicy from cloudflare.types.zero_trust.access.applications import ( + PolicyGetResponse, + PolicyListResponse, + PolicyCreateResponse, PolicyDeleteResponse, + PolicyUpdateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -28,7 +31,7 @@ def test_method_create(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -55,7 +58,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: purpose_justification_required=True, session_duration="24h", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -68,7 +71,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -81,7 +84,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -114,7 +117,7 @@ def test_method_update(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -142,7 +145,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: purpose_justification_required=True, session_duration="24h", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -156,7 +159,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -170,7 +173,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -212,7 +215,7 @@ def test_method_list(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(SyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -221,7 +224,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(SyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -234,7 +237,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -247,7 +250,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(SyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(SyncSinglePage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -361,7 +364,7 @@ def test_method_get(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -371,7 +374,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -385,7 +388,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -399,7 +402,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -445,7 +448,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -472,7 +475,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare purpose_justification_required=True, session_duration="24h", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -485,7 +488,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -498,7 +501,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -531,7 +534,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -559,7 +562,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare purpose_justification_required=True, session_duration="24h", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -573,7 +576,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -587,7 +590,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -629,7 +632,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(AsyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -638,7 +641,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(AsyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -651,7 +654,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -664,7 +667,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(AsyncSinglePage[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(AsyncSinglePage[PolicyListResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True @@ -778,7 +781,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -788,7 +791,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - app_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="account_id", ) - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -802,7 +805,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -816,7 +819,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" policy = await response.parse() - assert_matches_type(Optional[ApplicationPolicy], policy, path=["response"]) + assert_matches_type(Optional[PolicyGetResponse], policy, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py index 34cb5ec96f1..d884f3087b0 100755 --- a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py +++ b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py @@ -32,11 +32,28 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: policy_test = client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, decision="allow", exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, name="Allow devs", + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) @@ -135,11 +152,28 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare policy_test = await async_client.zero_trust.access.applications.policy_tests.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, decision="allow", exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, name="Allow devs", + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"]) diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 9ba489166cb..17ca2921b84 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -1052,6 +1052,12 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N "decision": "allow", "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], } @@ -2265,6 +2271,12 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N "decision": "allow", "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], } @@ -3653,6 +3665,12 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn "decision": "allow", "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], } @@ -4866,6 +4884,12 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn "decision": "allow", "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], } diff --git a/tests/api_resources/zero_trust/access/test_policies.py b/tests/api_resources/zero_trust/access/test_policies.py index fd986e438f9..5102dd04664 100644 --- a/tests/api_resources/zero_trust/access/test_policies.py +++ b/tests/api_resources/zero_trust/access/test_policies.py @@ -41,8 +41,25 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: decision="allow", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @@ -105,8 +122,25 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: decision="allow", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) @@ -317,8 +351,25 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare decision="allow", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(Optional[PolicyCreateResponse], policy, path=["response"]) @@ -381,8 +432,25 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare decision="allow", include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], name="Allow devs", + approval_groups=[ + { + "approvals_needed": 1, + "email_addresses": ["test1@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "email_list_uuid", + }, + { + "approvals_needed": 3, + "email_addresses": ["test@cloudflare.com", "test2@cloudflare.com"], + "email_list_uuid": "597147a1-976b-4ef2-9af0-81d5d007fc34", + }, + ], + approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + isolation_required=False, + purpose_justification_prompt="Please enter a justification for entering this protected domain.", + purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + session_duration="24h", ) assert_matches_type(Optional[PolicyUpdateResponse], policy, path=["response"]) diff --git a/tests/api_resources/zero_trust/dlp/test_entries.py b/tests/api_resources/zero_trust/dlp/test_entries.py index e438aca9d88..d0a651e7f92 100644 --- a/tests/api_resources/zero_trust/dlp/test_entries.py +++ b/tests/api_resources/zero_trust/dlp/test_entries.py @@ -115,6 +115,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "validation": "luhn", }, type="custom", + enabled=True, ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) @@ -183,6 +184,17 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + entry = client.zero_trust.dlp.entries.update( + entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + type="predefined", + enabled=True, + ) + assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: @@ -240,6 +252,17 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + entry = client.zero_trust.dlp.entries.update( + entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + type="integration", + enabled=True, + ) + assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: @@ -517,6 +540,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "validation": "luhn", }, type="custom", + enabled=True, ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) @@ -585,6 +609,17 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + entry = await async_client.zero_trust.dlp.entries.update( + entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + type="predefined", + enabled=True, + ) + assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -642,6 +677,17 @@ async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + entry = await async_client.zero_trust.dlp.entries.update( + entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_id="account_id", + type="integration", + enabled=True, + ) + assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) + @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: