diff --git a/pyproject.toml b/pyproject.toml index d99db120edf..c4e02052170 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -130,6 +130,7 @@ reportImplicitOverride = true reportImportCycles = false reportPrivateUsage = false + [tool.ruff] line-length = 120 output-format = "grouped" diff --git a/src/cloudflare/resources/bot_management.py b/src/cloudflare/resources/bot_management.py index 1948795a206..4956e7c85c4 100644 --- a/src/cloudflare/resources/bot_management.py +++ b/src/cloudflare/resources/bot_management.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, cast +from typing import Any, cast, overload from typing_extensions import Literal import httpx @@ -10,6 +10,7 @@ from ..types import BotManagementGetResponse, BotManagementUpdateResponse, bot_management_update_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -38,19 +39,60 @@ def with_raw_response(self) -> BotManagementWithRawResponse: def with_streaming_response(self) -> BotManagementWithStreamingResponse: return BotManagementWithStreamingResponse(self) + @overload def update( self, *, zone_id: str, - auto_update_model: bool | NotGiven = NOT_GIVEN, enable_js: bool | NotGiven = NOT_GIVEN, fight_mode: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + + fight_mode: Whether to enable Bot Fight Mode. + + 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, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, optimize_wordpress: bool | NotGiven = NOT_GIVEN, sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, - suppress_session_score: 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, @@ -73,14 +115,64 @@ def update( Args: zone_id: Identifier - auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as - they are released. - [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - fight_mode: Whether to enable Bot Fight Mode. + optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress. + + sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + + sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + static resources on your application need bot protection. Note: Static resource + protection can also result in legitimate traffic being blocked. + + sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests. + + 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, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, + optimize_wordpress: bool | NotGiven = NOT_GIVEN, + sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, + sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress. @@ -94,6 +186,53 @@ def update( sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests. + 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, + *, + zone_id: str, + auto_update_model: bool | NotGiven = NOT_GIVEN, + enable_js: bool | NotGiven = NOT_GIVEN, + suppress_session_score: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as + they are released. + [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot Management cookie. @@ -105,6 +244,29 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"]) + def update( + self, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, + fight_mode: bool | NotGiven = NOT_GIVEN, + optimize_wordpress: bool | NotGiven = NOT_GIVEN, + sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, + sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + auto_update_model: bool | NotGiven = NOT_GIVEN, + suppress_session_score: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -113,14 +275,14 @@ def update( f"/zones/{zone_id}/bot_management", body=maybe_transform( { - "auto_update_model": auto_update_model, "enable_js": enable_js, "fight_mode": fight_mode, "optimize_wordpress": optimize_wordpress, "sbfm_definitely_automated": sbfm_definitely_automated, - "sbfm_likely_automated": sbfm_likely_automated, "sbfm_static_resource_protection": sbfm_static_resource_protection, "sbfm_verified_bots": sbfm_verified_bots, + "sbfm_likely_automated": sbfm_likely_automated, + "auto_update_model": auto_update_model, "suppress_session_score": suppress_session_score, }, bot_management_update_params.BotManagementUpdateParams, @@ -192,19 +354,60 @@ def with_raw_response(self) -> AsyncBotManagementWithRawResponse: def with_streaming_response(self) -> AsyncBotManagementWithStreamingResponse: return AsyncBotManagementWithStreamingResponse(self) + @overload async def update( self, *, zone_id: str, - auto_update_model: bool | NotGiven = NOT_GIVEN, enable_js: bool | NotGiven = NOT_GIVEN, fight_mode: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + + fight_mode: Whether to enable Bot Fight Mode. + + 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, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, optimize_wordpress: bool | NotGiven = NOT_GIVEN, sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, - suppress_session_score: 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, @@ -227,14 +430,64 @@ async def update( Args: zone_id: Identifier - auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as - they are released. - [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - fight_mode: Whether to enable Bot Fight Mode. + optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress. + + sbfm_definitely_automated: Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + + sbfm_static_resource_protection: Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + static resources on your application need bot protection. Note: Static resource + protection can also result in legitimate traffic being blocked. + + sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests. + + 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, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, + optimize_wordpress: bool | NotGiven = NOT_GIVEN, + sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, + sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). optimize_wordpress: Whether to optimize Super Bot Fight Mode protections for Wordpress. @@ -248,6 +501,53 @@ async def update( sbfm_verified_bots: Super Bot Fight Mode (SBFM) action to take on verified bots requests. + 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, + *, + zone_id: str, + auto_update_model: bool | NotGiven = NOT_GIVEN, + enable_js: bool | NotGiven = NOT_GIVEN, + suppress_session_score: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: + """ + Updates the Bot Management configuration for a zone. + + This API is used to update: + + - **Bot Fight Mode** + - **Super Bot Fight Mode** + - **Bot Management for Enterprise** + + See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more + information on the different plans + + Args: + zone_id: Identifier + + auto_update_model: Automatically update to the newest bot detection models created by Cloudflare as + they are released. + [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + + enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot Management cookie. @@ -259,6 +559,29 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"]) + async def update( + self, + *, + zone_id: str, + enable_js: bool | NotGiven = NOT_GIVEN, + fight_mode: bool | NotGiven = NOT_GIVEN, + optimize_wordpress: bool | NotGiven = NOT_GIVEN, + sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + sbfm_static_resource_protection: bool | NotGiven = NOT_GIVEN, + sbfm_verified_bots: Literal["allow", "block"] | NotGiven = NOT_GIVEN, + sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | NotGiven = NOT_GIVEN, + auto_update_model: bool | NotGiven = NOT_GIVEN, + suppress_session_score: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BotManagementUpdateResponse: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -267,14 +590,14 @@ async def update( f"/zones/{zone_id}/bot_management", body=await async_maybe_transform( { - "auto_update_model": auto_update_model, "enable_js": enable_js, "fight_mode": fight_mode, "optimize_wordpress": optimize_wordpress, "sbfm_definitely_automated": sbfm_definitely_automated, - "sbfm_likely_automated": sbfm_likely_automated, "sbfm_static_resource_protection": sbfm_static_resource_protection, "sbfm_verified_bots": sbfm_verified_bots, + "sbfm_likely_automated": sbfm_likely_automated, + "auto_update_model": auto_update_model, "suppress_session_score": suppress_session_score, }, bot_management_update_params.BotManagementUpdateParams, diff --git a/src/cloudflare/resources/cache/cache.py b/src/cloudflare/resources/cache/cache.py index db99099e895..47c6d235c49 100644 --- a/src/cloudflare/resources/cache/cache.py +++ b/src/cloudflare/resources/cache/cache.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List, Type, Optional, cast +from typing import List, Type, Optional, cast, overload import httpx from ...types import CachePurgeResponse, cache_purge_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -85,15 +86,177 @@ def with_raw_response(self) -> CacheWithRawResponse: def with_streaming_response(self) -> CacheWithStreamingResponse: return CacheWithStreamingResponse(self) + @overload + def purge( + self, + *, + zone_id: str, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( self, *, zone_id: str, - files: List[cache_purge_params.File] | NotGiven = NOT_GIVEN, hosts: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( + self, + *, + zone_id: str, prefixes: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( + self, + *, + zone_id: str, purge_everything: bool | NotGiven = NOT_GIVEN, - tags: 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, @@ -141,17 +304,91 @@ def purge( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def purge( + self, + *, + zone_id: str, + files: List[cache_purge_params.CachePurgeFilesFile] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 + """ + ... + + @required_args(["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"]) + def purge( + self, + *, + zone_id: str, + tags: List[str] | NotGiven = NOT_GIVEN, + hosts: List[str] | NotGiven = NOT_GIVEN, + prefixes: List[str] | NotGiven = NOT_GIVEN, + purge_everything: bool | NotGiven = NOT_GIVEN, + files: List[cache_purge_params.CachePurgeFilesFile] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( f"/zones/{zone_id}/purge_cache", body=maybe_transform( { - "files": files, + "tags": tags, "hosts": hosts, "prefixes": prefixes, "purge_everything": purge_everything, - "tags": tags, + "files": files, }, cache_purge_params.CachePurgeParams, ), @@ -191,15 +428,177 @@ def with_raw_response(self) -> AsyncCacheWithRawResponse: def with_streaming_response(self) -> AsyncCacheWithStreamingResponse: return AsyncCacheWithStreamingResponse(self) + @overload + async def purge( + self, + *, + zone_id: str, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( self, *, zone_id: str, - files: List[cache_purge_params.File] | NotGiven = NOT_GIVEN, hosts: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( + self, + *, + zone_id: str, prefixes: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 purge( + self, + *, + zone_id: str, purge_everything: bool | NotGiven = NOT_GIVEN, - tags: 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, @@ -247,17 +646,91 @@ async def purge( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def purge( + self, + *, + zone_id: str, + files: List[cache_purge_params.CachePurgeFilesFile] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: + """### Purge All Cached Content + + Removes ALL files from Cloudflare's cache. + + All tiers can purge everything. + + ### Purge Cached Content by URL + + Granularly removes one or more files from Cloudflare's cache by specifying URLs. + All tiers can purge by URL. + + To purge files with custom cache keys, include the headers used to compute the + cache key as in the example. If you have a device type or geo in your cache key, + you will need to include the CF-Device-Type or CF-IPCountry headers. If you have + lang in your cache key, you will need to include the Accept-Language header. + + **NB:** When including the Origin header, be sure to include the **scheme** and + **hostname**. The port number can be omitted if it is the default port (80 for + http, 443 for https), but must be included otherwise. + + ### Purge Cached Content by Tag, Host or Prefix + + Granularly removes one or more files from Cloudflare's cache either by + specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise + customers are permitted to purge by Tag, Host or Prefix. + + **NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 + purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or + prefixes in one API call. This rate limit can be raised for customers who need + to purge at higher volume. + + Args: + 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 + """ + ... + + @required_args(["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"], ["zone_id"]) + async def purge( + self, + *, + zone_id: str, + tags: List[str] | NotGiven = NOT_GIVEN, + hosts: List[str] | NotGiven = NOT_GIVEN, + prefixes: List[str] | NotGiven = NOT_GIVEN, + purge_everything: bool | NotGiven = NOT_GIVEN, + files: List[cache_purge_params.CachePurgeFilesFile] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[CachePurgeResponse]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( f"/zones/{zone_id}/purge_cache", body=await async_maybe_transform( { - "files": files, + "tags": tags, "hosts": hosts, "prefixes": prefixes, "purge_everything": purge_everything, - "tags": tags, + "files": files, }, cache_purge_params.CachePurgeParams, ), diff --git a/src/cloudflare/resources/dns/records.py b/src/cloudflare/resources/dns/records.py index 8ac3ffeca6b..c0e7e7306b4 100644 --- a/src/cloudflare/resources/dns/records.py +++ b/src/cloudflare/resources/dns/records.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Any, List, Type, Union, Optional, cast +from typing import Any, List, Type, Union, Optional, cast, overload from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -50,38 +51,15 @@ def with_raw_response(self) -> RecordsWithRawResponse: def with_streaming_response(self) -> RecordsWithStreamingResponse: return RecordsWithStreamingResponse(self) + @overload def create( self, *, zone_id: str, + content: str, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + type: Literal["A"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_create_params.Data | NotGiven = NOT_GIVEN, - meta: record_create_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -105,6 +83,8 @@ def create( Args: zone_id: Identifier + content: A valid IPv4 address. + name: DNS record name (or @ for the zone apex) in Punycode. type: Record type. @@ -112,11 +92,6 @@ def create( comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. - - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -134,73 +109,17 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - DNSRecord, - self._post( - f"/zones/{zone_id}/dns_records", - body=maybe_transform( - { - "name": name, - "type": type, - "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, - "proxied": proxied, - "tags": tags, - "ttl": ttl, - }, - record_create_params.RecordCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def update( + @overload + def create( self, - dns_record_id: str, *, zone_id: str, + content: str, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + type: Literal["AAAA"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_update_params.Data | NotGiven = NOT_GIVEN, - meta: record_update_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -211,7 +130,8 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DNSRecord: - """Overwrite an existing DNS record. + """ + Create a new DNS record for a zone. Notes: @@ -223,7 +143,7 @@ def update( Args: zone_id: Identifier - dns_record_id: Identifier + content: A valid IPv6 address. name: DNS record name (or @ for the zone apex) in Punycode. @@ -232,11 +152,6 @@ def update( comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. - - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -254,126 +169,53 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return cast( - DNSRecord, - self._put( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - body=maybe_transform( - { - "name": name, - "type": type, - "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, - "proxied": proxied, - "tags": tags, - "ttl": ttl, - }, - record_update_params.RecordUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def list( + @overload + def create( self, *, zone_id: str, - comment: record_list_params.Comment | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - tag: record_list_params.Tag | NotGiven = NOT_GIVEN, - tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - type: Literal[ - "A", - "AAAA", - "CAA", - "CERT", - "CNAME", - "DNSKEY", - "DS", - "HTTPS", - "LOC", - "MX", - "NAPTR", - "NS", - "PTR", - "SMIMEA", - "SRV", - "SSHFP", - "SVCB", - "TLSA", - "TXT", - "URI", - ] - | NotGiven = NOT_GIVEN, + data: record_create_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncV4PagePaginationArray[DNSRecord]: + ) -> DNSRecord: """ - List, search, sort, and filter a zones' DNS records. + Create a new DNS record for a zone. - Args: - zone_id: Identifier + Notes: - content: DNS record content. + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. - direction: Direction to order DNS records in. + Args: + zone_id: Identifier - match: Whether to match all search requirements or at least one (any). If set to `all`, - acts like a logical AND between filters. If set to `any`, acts like a logical OR - instead. Note that the interaction between tag filters is controlled by the - `tag-match` parameter instead. + data: Components of a CAA record. name: DNS record name (or @ for the zone apex) in Punycode. - order: Field to order DNS records by. - - page: Page number of paginated results. - - per_page: Number of DNS records per page. - - proxied: Whether the record is receiving the performance and security benefits of - Cloudflare. + type: Record type. - search: Allows searching in multiple properties of a DNS record simultaneously. This - parameter is intended for human users, not automation. Its exact behavior is - intentionally left unspecified and is subject to change in the future. This - parameter works independently of the `match` setting. For automated searches, - please use the other available parameters. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - tag_match: Whether to match all tag search requirements or at least one (any). If set to - `all`, acts like a logical AND between tag filters. If set to `any`, acts like a - logical OR instead. Note that the regular `match` parameter is still used to - combine the resulting condition with other filters that aren't related to tags. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. - type: Record type. + 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. extra_headers: Send extra headers @@ -383,57 +225,53 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - 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}/dns_records", - page=SyncV4PagePaginationArray[DNSRecord], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "comment": comment, - "content": content, - "direction": direction, - "match": match, - "name": name, - "order": order, - "page": page, - "per_page": per_page, - "proxied": proxied, - "search": search, - "tag": tag, - "tag_match": tag_match, - "type": type, - }, - record_list_params.RecordListParams, - ), - ), - model=cast(Any, DNSRecord), # Union types cannot be passed in as arguments in the type system - ) + ... - def delete( + @overload + def create( self, - dns_record_id: str, *, zone_id: str, + data: record_create_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordDeleteResponse]: + ) -> DNSRecord: """ - Delete DNS Record + Create a new DNS record for a zone. - Args: - zone_id: Identifier + Notes: - dns_record_id: Identifier + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. extra_headers: Send extra headers @@ -443,55 +281,17 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return self._delete( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[RecordDeleteResponse]], ResultWrapper[RecordDeleteResponse]), - ) + ... - def edit( + @overload + def create( self, - dns_record_id: str, *, zone_id: str, + content: object, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + type: Literal["CNAME"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_edit_params.Data | NotGiven = NOT_GIVEN, - meta: record_edit_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, @@ -502,7 +302,8 @@ def edit( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DNSRecord: - """Update an existing DNS record. + """ + Create a new DNS record for a zone. Notes: @@ -514,7 +315,7 @@ def edit( Args: zone_id: Identifier - dns_record_id: Identifier + content: A valid hostname. Must not match the record's name. name: DNS record name (or @ for the zone apex) in Punycode. @@ -523,11 +324,6 @@ def edit( comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. - - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - proxied: Whether the record is receiving the performance and security benefits of Cloudflare. @@ -545,65 +341,54 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return cast( - DNSRecord, - self._patch( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - body=maybe_transform( - { - "name": name, - "type": type, - "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, - "proxied": proxied, - "tags": tags, - "ttl": ttl, - }, - record_edit_params.RecordEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def export( + @overload + def create( self, *, zone_id: str, + data: record_create_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: + ) -> DNSRecord: """ - You can export your - [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this - endpoint. + Create a new DNS record for a zone. - See - [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") - for more information. + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -612,22 +397,19 @@ def export( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - extra_headers = {"Accept": "text/plain", **(extra_headers or {})} - return self._get( - f"/zones/{zone_id}/dns_records/export", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) + ... - def get( + @overload + def create( self, - dns_record_id: str, *, zone_id: str, + data: record_create_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | 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, @@ -636,12 +418,32 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DNSRecord: """ - DNS Record Details + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier - dns_record_id: Identifier + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. extra_headers: Send extra headers @@ -651,62 +453,53 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return cast( - DNSRecord, - self._get( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def import_( + @overload + def create( self, *, zone_id: str, - file: str, - proxied: str | NotGiven = NOT_GIVEN, + data: record_create_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RecordImportResponse: + ) -> DNSRecord: """ - You can upload your - [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this - endpoint. It assumes that cURL is called from a location with bind_config.txt - (valid BIND config) present. + Create a new DNS record for a zone. - See - [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") - for more information. + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier - file: BIND config to import. + data: Components of a HTTPS record. - **Tip:** When using cURL, a file can be uploaded using - `--form 'file=@bind_config.txt'`. + name: DNS record name (or @ for the zone apex) in Punycode. - proxied: Whether or not proxiable records should receive the performance and security - benefits of Cloudflare. + type: Record type. - The value should be either `true` or `false`. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. extra_headers: Send extra headers @@ -716,45 +509,54 @@ def import_( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( - f"/zones/{zone_id}/dns_records/import", - body=maybe_transform( - { - "file": file, - "proxied": proxied, - }, - record_import_params.RecordImportParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[RecordImportResponse], ResultWrapper[RecordImportResponse]), - ) + ... - def scan( + @overload + def create( self, *, zone_id: str, + data: record_create_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RecordScanResponse: + ) -> DNSRecord: """ - Scan for common DNS records on your domain and automatically add them to your - zone. Useful if you haven't updated your nameservers yet. + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -763,63 +565,18 @@ def scan( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._post( - f"/zones/{zone_id}/dns_records/scan", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[RecordScanResponse], ResultWrapper[RecordScanResponse]), - ) + ... - -class AsyncRecords(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRecordsWithRawResponse: - return AsyncRecordsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRecordsWithStreamingResponse: - return AsyncRecordsWithStreamingResponse(self) - - async def create( + @overload + def create( self, *, zone_id: str, + content: str, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + priority: float, + type: Literal["MX"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_create_params.Data | NotGiven = NOT_GIVEN, - meta: record_create_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -842,21 +599,18 @@ async def create( Args: zone_id: Identifier + content: A valid mail server hostname. + name: DNS record name (or @ for the zone apex) in Punycode. + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + type: Record type. comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. - - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - - proxied: Whether the record is receiving the performance and security benefits of - Cloudflare. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -871,74 +625,17 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - DNSRecord, - await self._post( - f"/zones/{zone_id}/dns_records", - body=await async_maybe_transform( - { - "name": name, - "type": type, - "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, - "proxied": proxied, - "tags": tags, - "ttl": ttl, - }, - record_create_params.RecordCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - async def update( + @overload + def create( self, - dns_record_id: str, *, zone_id: str, + data: record_create_params.DNSRecordsNAPTRRecordData, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + type: Literal["NAPTR"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_update_params.Data | NotGiven = NOT_GIVEN, - meta: record_update_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -948,7 +645,8 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DNSRecord: - """Overwrite an existing DNS record. + """ + Create a new DNS record for a zone. Notes: @@ -960,7 +658,7 @@ async def update( Args: zone_id: Identifier - dns_record_id: Identifier + data: Components of a NAPTR record. name: DNS record name (or @ for the zone apex) in Punycode. @@ -969,14 +667,6 @@ async def update( comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. - - priority: Required for MX, SRV and URI records; unused by other record types. Records with - lower priorities are preferred. - - proxied: Whether the record is receiving the performance and security benefits of - Cloudflare. - tags: Custom tags for the DNS record. This field has no effect on DNS responses. ttl: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. @@ -991,127 +681,7278 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return cast( - DNSRecord, - await self._put( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - body=await async_maybe_transform( - { - "name": name, - "type": type, - "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, - "proxied": proxied, - "tags": tags, - "ttl": ttl, - }, - record_update_params.RecordUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[DNSRecord] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def list( + @overload + def create( self, *, zone_id: str, - comment: record_list_params.Comment | NotGiven = NOT_GIVEN, - content: str | NotGiven = NOT_GIVEN, - direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, - match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, - page: float | NotGiven = NOT_GIVEN, - per_page: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - tag: record_list_params.Tag | NotGiven = NOT_GIVEN, - tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, - type: Literal[ - "A", - "AAAA", - "CAA", - "CERT", - "CNAME", - "DNSKEY", - "DS", - "HTTPS", - "LOC", - "MX", - "NAPTR", - "NS", - "PTR", - "SMIMEA", - "SRV", - "SSHFP", - "SVCB", - "TLSA", - "TXT", - "URI", - ] - | NotGiven = NOT_GIVEN, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[DNSRecord, AsyncV4PagePaginationArray[DNSRecord]]: + ) -> DNSRecord: """ - List, search, sort, and filter a zones' DNS records. + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier - content: DNS record content. + content: A valid name server host name. - direction: Direction to order DNS records in. + name: DNS record name (or @ for the zone apex) in Punycode. - match: Whether to match all search requirements or at least one (any). If set to `all`, - acts like a logical AND between filters. If set to `any`, acts like a logical OR - instead. Note that the interaction between tag filters is controlled by the - `tag-match` parameter instead. + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SSHFP record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["TXT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: Text content for the record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 + """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + def create( + self, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_create_params.DNSRecordsCAARecordData + | record_create_params.DNSRecordsCERTRecordData + | record_create_params.DNSRecordsDNSKEYRecordData + | record_create_params.DNSRecordsDSRecordData + | record_create_params.DNSRecordsHTTPSRecordData + | record_create_params.DNSRecordsLOCRecordData + | record_create_params.DNSRecordsNAPTRRecordData + | record_create_params.DNSRecordsSMIMEARecordData + | record_create_params.DNSRecordsSRVRecordData + | record_create_params.DNSRecordsSSHFPRecordData + | record_create_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return cast( + DNSRecord, + self._post( + f"/zones/{zone_id}/dns_records", + body=maybe_transform( + { + "content": content, + "name": name, + "type": type, + "comment": comment, + "proxied": proxied, + "tags": tags, + "ttl": ttl, + "data": data, + "priority": priority, + }, + record_create_params.RecordCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + @overload + def update( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["A"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv4 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["AAAA"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv6 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CAA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["CNAME"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid hostname. Must not match the record's name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a HTTPS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + priority: float, + type: Literal["MX"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid mail server hostname. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsNAPTRRecordData, + name: str, + type: Literal["NAPTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a NAPTR record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid name server host name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SSHFP record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["TXT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Text content for the record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 + """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + def update( + self, + dns_record_id: str, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_update_params.DNSRecordsCAARecordData + | record_update_params.DNSRecordsCERTRecordData + | record_update_params.DNSRecordsDNSKEYRecordData + | record_update_params.DNSRecordsDSRecordData + | record_update_params.DNSRecordsHTTPSRecordData + | record_update_params.DNSRecordsLOCRecordData + | record_update_params.DNSRecordsNAPTRRecordData + | record_update_params.DNSRecordsSMIMEARecordData + | record_update_params.DNSRecordsSRVRecordData + | record_update_params.DNSRecordsSSHFPRecordData + | record_update_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return cast( + DNSRecord, + self._put( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + body=maybe_transform( + { + "content": content, + "name": name, + "type": type, + "comment": comment, + "proxied": proxied, + "tags": tags, + "ttl": ttl, + "data": data, + "priority": priority, + }, + record_update_params.RecordUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + zone_id: str, + comment: record_list_params.Comment | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + tag: record_list_params.Tag | NotGiven = NOT_GIVEN, + tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + type: Literal[ + "A", + "AAAA", + "CAA", + "CERT", + "CNAME", + "DNSKEY", + "DS", + "HTTPS", + "LOC", + "MX", + "NAPTR", + "NS", + "PTR", + "SMIMEA", + "SRV", + "SSHFP", + "SVCB", + "TLSA", + "TXT", + "URI", + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncV4PagePaginationArray[DNSRecord]: + """ + List, search, sort, and filter a zones' DNS records. + + Args: + zone_id: Identifier + + content: DNS record content. + + direction: Direction to order DNS records in. + + match: Whether to match all search requirements or at least one (any). If set to `all`, + acts like a logical AND between filters. If set to `any`, acts like a logical OR + instead. Note that the interaction between tag filters is controlled by the + `tag-match` parameter instead. + + name: DNS record name (or @ for the zone apex) in Punycode. + + order: Field to order DNS records by. + + page: Page number of paginated results. + + per_page: Number of DNS records per page. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + search: Allows searching in multiple properties of a DNS record simultaneously. This + parameter is intended for human users, not automation. Its exact behavior is + intentionally left unspecified and is subject to change in the future. This + parameter works independently of the `match` setting. For automated searches, + please use the other available parameters. + + tag_match: Whether to match all tag search requirements or at least one (any). If set to + `all`, acts like a logical AND between tag filters. If set to `any`, acts like a + logical OR instead. Note that the regular `match` parameter is still used to + combine the resulting condition with other filters that aren't related to tags. + + type: Record type. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + 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}/dns_records", + page=SyncV4PagePaginationArray[DNSRecord], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "comment": comment, + "content": content, + "direction": direction, + "match": match, + "name": name, + "order": order, + "page": page, + "per_page": per_page, + "proxied": proxied, + "search": search, + "tag": tag, + "tag_match": tag_match, + "type": type, + }, + record_list_params.RecordListParams, + ), + ), + model=cast(Any, DNSRecord), # Union types cannot be passed in as arguments in the type system + ) + + def delete( + self, + dns_record_id: str, + *, + zone_id: str, + # 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[RecordDeleteResponse]: + """ + Delete DNS Record + + Args: + zone_id: Identifier + + dns_record_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 + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return self._delete( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[Optional[RecordDeleteResponse]], ResultWrapper[RecordDeleteResponse]), + ) + + @overload + def edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["A"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv4 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["AAAA"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv6 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CAA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["CNAME"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid hostname. Must not match the record's name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a HTTPS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + priority: float, + type: Literal["MX"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid mail server hostname. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsNAPTRRecordData, + name: str, + type: Literal["NAPTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a NAPTR record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid name server host name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SSHFP record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["TXT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Text content for the record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 + """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + def edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_edit_params.DNSRecordsCAARecordData + | record_edit_params.DNSRecordsCERTRecordData + | record_edit_params.DNSRecordsDNSKEYRecordData + | record_edit_params.DNSRecordsDSRecordData + | record_edit_params.DNSRecordsHTTPSRecordData + | record_edit_params.DNSRecordsLOCRecordData + | record_edit_params.DNSRecordsNAPTRRecordData + | record_edit_params.DNSRecordsSMIMEARecordData + | record_edit_params.DNSRecordsSRVRecordData + | record_edit_params.DNSRecordsSSHFPRecordData + | record_edit_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return cast( + DNSRecord, + self._patch( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + body=maybe_transform( + { + "content": content, + "name": name, + "type": type, + "comment": comment, + "proxied": proxied, + "tags": tags, + "ttl": ttl, + "data": data, + "priority": priority, + }, + record_edit_params.RecordEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def export( + self, + *, + zone_id: str, + # 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, + ) -> str: + """ + You can export your + [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this + endpoint. + + See + [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") + for more information. + + Args: + zone_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 + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} + return self._get( + f"/zones/{zone_id}/dns_records/export", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + def get( + self, + dns_record_id: str, + *, + zone_id: str, + # 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, + ) -> DNSRecord: + """ + DNS Record Details + + Args: + zone_id: Identifier + + dns_record_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 + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return cast( + DNSRecord, + self._get( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def import_( + self, + *, + zone_id: str, + file: str, + proxied: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RecordImportResponse: + """ + You can upload your + [BIND config](https://en.wikipedia.org/wiki/Zone_file "Zone file") through this + endpoint. It assumes that cURL is called from a location with bind_config.txt + (valid BIND config) present. + + See + [the documentation](https://developers.cloudflare.com/dns/manage-dns-records/how-to/import-and-export/ "Import and export records") + for more information. + + Args: + zone_id: Identifier + + file: BIND config to import. + + **Tip:** When using cURL, a file can be uploaded using + `--form 'file=@bind_config.txt'`. + + proxied: Whether or not proxiable records should receive the performance and security + benefits of Cloudflare. + + The value should be either `true` or `false`. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/dns_records/import", + body=maybe_transform( + { + "file": file, + "proxied": proxied, + }, + record_import_params.RecordImportParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[RecordImportResponse], ResultWrapper[RecordImportResponse]), + ) + + def scan( + self, + *, + zone_id: str, + # 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, + ) -> RecordScanResponse: + """ + Scan for common DNS records on your domain and automatically add them to your + zone. Useful if you haven't updated your nameservers yet. + + Args: + zone_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 + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/dns_records/scan", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[RecordScanResponse], ResultWrapper[RecordScanResponse]), + ) + + +class AsyncRecords(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRecordsWithRawResponse: + return AsyncRecordsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRecordsWithStreamingResponse: + return AsyncRecordsWithStreamingResponse(self) + + @overload + async def create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["A"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: A valid IPv4 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["AAAA"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: A valid IPv6 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a CAA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: object, + name: str, + type: Literal["CNAME"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: A valid hostname. Must not match the record's name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a HTTPS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + priority: float, + type: Literal["MX"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: A valid mail server hostname. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsNAPTRRecordData, + name: str, + type: Literal["NAPTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a NAPTR record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: A valid name server host name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SSHFP record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + content: str, + name: str, + type: Literal["TXT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + content: Text content for the record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 create( + self, + *, + zone_id: str, + data: record_create_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """ + Create a new DNS record for a zone. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 + """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + async def create( + self, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_create_params.DNSRecordsCAARecordData + | record_create_params.DNSRecordsCERTRecordData + | record_create_params.DNSRecordsDNSKEYRecordData + | record_create_params.DNSRecordsDSRecordData + | record_create_params.DNSRecordsHTTPSRecordData + | record_create_params.DNSRecordsLOCRecordData + | record_create_params.DNSRecordsNAPTRRecordData + | record_create_params.DNSRecordsSMIMEARecordData + | record_create_params.DNSRecordsSRVRecordData + | record_create_params.DNSRecordsSSHFPRecordData + | record_create_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return cast( + DNSRecord, + await self._post( + f"/zones/{zone_id}/dns_records", + body=await async_maybe_transform( + { + "content": content, + "name": name, + "type": type, + "comment": comment, + "proxied": proxied, + "tags": tags, + "ttl": ttl, + "data": data, + "priority": priority, + }, + record_create_params.RecordCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + @overload + async def update( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["A"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv4 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["AAAA"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv6 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CAA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["CNAME"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid hostname. Must not match the record's name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a HTTPS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + priority: float, + type: Literal["MX"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid mail server hostname. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsNAPTRRecordData, + name: str, + type: Literal["NAPTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a NAPTR record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid name server host name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SSHFP record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["TXT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Text content for the record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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, + dns_record_id: str, + *, + zone_id: str, + data: record_update_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Overwrite an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 + """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + async def update( + self, + dns_record_id: str, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_update_params.DNSRecordsCAARecordData + | record_update_params.DNSRecordsCERTRecordData + | record_update_params.DNSRecordsDNSKEYRecordData + | record_update_params.DNSRecordsDSRecordData + | record_update_params.DNSRecordsHTTPSRecordData + | record_update_params.DNSRecordsLOCRecordData + | record_update_params.DNSRecordsNAPTRRecordData + | record_update_params.DNSRecordsSMIMEARecordData + | record_update_params.DNSRecordsSRVRecordData + | record_update_params.DNSRecordsSSHFPRecordData + | record_update_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return cast( + DNSRecord, + await self._put( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + body=await async_maybe_transform( + { + "content": content, + "name": name, + "type": type, + "comment": comment, + "proxied": proxied, + "tags": tags, + "ttl": ttl, + "data": data, + "priority": priority, + }, + record_update_params.RecordUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[DNSRecord] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + zone_id: str, + comment: record_list_params.Comment | NotGiven = NOT_GIVEN, + content: str | NotGiven = NOT_GIVEN, + direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN, + match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + order: Literal["type", "name", "content", "ttl", "proxied"] | NotGiven = NOT_GIVEN, + page: float | NotGiven = NOT_GIVEN, + per_page: float | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + tag: record_list_params.Tag | NotGiven = NOT_GIVEN, + tag_match: Literal["any", "all"] | NotGiven = NOT_GIVEN, + type: Literal[ + "A", + "AAAA", + "CAA", + "CERT", + "CNAME", + "DNSKEY", + "DS", + "HTTPS", + "LOC", + "MX", + "NAPTR", + "NS", + "PTR", + "SMIMEA", + "SRV", + "SSHFP", + "SVCB", + "TLSA", + "TXT", + "URI", + ] + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[DNSRecord, AsyncV4PagePaginationArray[DNSRecord]]: + """ + List, search, sort, and filter a zones' DNS records. + + Args: + zone_id: Identifier + + content: DNS record content. + + direction: Direction to order DNS records in. + + match: Whether to match all search requirements or at least one (any). If set to `all`, + acts like a logical AND between filters. If set to `any`, acts like a logical OR + instead. Note that the interaction between tag filters is controlled by the + `tag-match` parameter instead. + + name: DNS record name (or @ for the zone apex) in Punycode. + + order: Field to order DNS records by. + + page: Page number of paginated results. + + per_page: Number of DNS records per page. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + search: Allows searching in multiple properties of a DNS record simultaneously. This + parameter is intended for human users, not automation. Its exact behavior is + intentionally left unspecified and is subject to change in the future. This + parameter works independently of the `match` setting. For automated searches, + please use the other available parameters. + + tag_match: Whether to match all tag search requirements or at least one (any). If set to + `all`, acts like a logical AND between tag filters. If set to `any`, acts like a + logical OR instead. Note that the regular `match` parameter is still used to + combine the resulting condition with other filters that aren't related to tags. + + type: Record type. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not zone_id: + 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}/dns_records", + page=AsyncV4PagePaginationArray[DNSRecord], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "comment": comment, + "content": content, + "direction": direction, + "match": match, + "name": name, + "order": order, + "page": page, + "per_page": per_page, + "proxied": proxied, + "search": search, + "tag": tag, + "tag_match": tag_match, + "type": type, + }, + record_list_params.RecordListParams, + ), + ), + model=cast(Any, DNSRecord), # Union types cannot be passed in as arguments in the type system + ) + + async def delete( + self, + dns_record_id: str, + *, + zone_id: str, + # 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[RecordDeleteResponse]: + """ + Delete DNS Record + + Args: + zone_id: Identifier + + dns_record_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 + """ + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not dns_record_id: + raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") + return await self._delete( + f"/zones/{zone_id}/dns_records/{dns_record_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[Optional[RecordDeleteResponse]], ResultWrapper[RecordDeleteResponse]), + ) + + @overload + async def edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["A"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv4 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["AAAA"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid IPv6 address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsCAARecordData, + name: str, + type: Literal["CAA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CAA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsCERTRecordData, + name: str, + type: Literal["CERT"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a CERT record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["CNAME"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid hostname. Must not match the record's name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + proxied: Whether the record is receiving the performance and security benefits of + Cloudflare. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsDNSKEYRecordData, + name: str, + type: Literal["DNSKEY"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DNSKEY record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsDSRecordData, + name: str, + type: Literal["DS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a DS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsHTTPSRecordData, + name: str, + type: Literal["HTTPS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a HTTPS record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsLOCRecordData, + name: str, + type: Literal["LOC"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a LOC record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + priority: float, + type: Literal["MX"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid mail server hostname. + + name: DNS record name (or @ for the zone apex) in Punycode. + + priority: Required for MX, SRV and URI records; unused by other record types. Records with + lower priorities are preferred. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsNAPTRRecordData, + name: str, + type: Literal["NAPTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a NAPTR record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: object, + name: str, + type: Literal["NS"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: A valid name server host name. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str, + name: str, + type: Literal["PTR"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + content: Domain name pointing to the address. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSMIMEARecordData, + name: str, + type: Literal["SMIMEA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SMIMEA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSRVRecordData, + name: str, + type: Literal["SRV"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SRV record. + + name: DNS record name (or @ for the zone apex) in Punycode. For SRV records, the first + label is normally a service and the second a protocol name, each starting with + an underscore. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSSHFPRecordData, + name: str, + type: Literal["SSHFP"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SSHFP record. name: DNS record name (or @ for the zone apex) in Punycode. - order: Field to order DNS records by. + type: Record type. - page: Page number of paginated results. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. - per_page: Number of DNS records per page. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. - proxied: Whether the record is receiving the performance and security benefits of - Cloudflare. + 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. - search: Allows searching in multiple properties of a DNS record simultaneously. This - parameter is intended for human users, not automation. Its exact behavior is - intentionally left unspecified and is subject to change in the future. This - parameter works independently of the `match` setting. For automated searches, - please use the other available parameters. + extra_headers: Send extra headers - tag_match: Whether to match all tag search requirements or at least one (any). If set to - `all`, acts like a logical AND between tag filters. If set to `any`, acts like a - logical OR instead. Note that the regular `match` parameter is still used to - combine the resulting condition with other filters that aren't related to tags. + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsSVCBRecordData, + name: str, + type: Literal["SVCB"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a SVCB record. + + name: DNS record name (or @ for the zone apex) in Punycode. type: Record type. + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1120,58 +7961,56 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - 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}/dns_records", - page=AsyncV4PagePaginationArray[DNSRecord], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "comment": comment, - "content": content, - "direction": direction, - "match": match, - "name": name, - "order": order, - "page": page, - "per_page": per_page, - "proxied": proxied, - "search": search, - "tag": tag, - "tag_match": tag_match, - "type": type, - }, - record_list_params.RecordListParams, - ), - ), - model=cast(Any, DNSRecord), # Union types cannot be passed in as arguments in the type system - ) + ... - async def delete( + @overload + async def edit( self, dns_record_id: str, *, zone_id: str, + data: record_edit_params.DNSRecordsTLSARecordData, + name: str, + type: Literal["TLSA"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RecordDeleteResponse]: - """ - Delete DNS Record + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. Args: zone_id: Identifier dns_record_id: Identifier + data: Components of a TLSA record. + + name: DNS record name (or @ for the zone apex) in Punycode. + + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. + + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1180,56 +8019,18 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not dns_record_id: - raise ValueError(f"Expected a non-empty value for `dns_record_id` but received {dns_record_id!r}") - return await self._delete( - f"/zones/{zone_id}/dns_records/{dns_record_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[RecordDeleteResponse]], ResultWrapper[RecordDeleteResponse]), - ) + ... + @overload async def edit( self, dns_record_id: str, *, zone_id: str, + content: str, name: str, - type: Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ], + type: Literal["TXT"], comment: str | NotGiven = NOT_GIVEN, - content: object | NotGiven = NOT_GIVEN, - data: record_edit_params.Data | NotGiven = NOT_GIVEN, - meta: record_edit_params.Meta | NotGiven = NOT_GIVEN, - priority: float | NotGiven = NOT_GIVEN, - proxied: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1253,6 +8054,8 @@ async def edit( dns_record_id: Identifier + content: Text content for the record. + name: DNS record name (or @ for the zone apex) in Punycode. type: Record type. @@ -1260,13 +8063,67 @@ async def edit( comment: Comments or notes about the DNS record. This field has no effect on DNS responses. - content: Formatted URI content. See 'data' to set URI properties. + tags: Custom tags for the DNS record. This field has no effect on DNS responses. + + 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. + + 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 edit( + self, + dns_record_id: str, + *, + zone_id: str, + data: record_edit_params.DNSRecordsURIRecordData, + name: str, + priority: float, + type: Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: + """Update an existing DNS record. + + Notes: + + - A/AAAA records cannot exist on the same name as CNAME records. + - NS records cannot exist on the same name as any other record type. + - Domain names are always represented in Punycode, even if Unicode characters + were used when creating the record. + + Args: + zone_id: Identifier + + dns_record_id: Identifier + + data: Components of a URI record. + + name: DNS record name (or @ for the zone apex) in Punycode. priority: Required for MX, SRV and URI records; unused by other record types. Records with lower priorities are preferred. - proxied: Whether the record is receiving the performance and security benefits of - Cloudflare. + type: Record type. + + comment: Comments or notes about the DNS record. This field has no effect on DNS + responses. tags: Custom tags for the DNS record. This field has no effect on DNS responses. @@ -1282,6 +8139,81 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "priority", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "data", "name", "type"], + ["zone_id", "content", "name", "type"], + ["zone_id", "data", "name", "priority", "type"], + ) + async def edit( + self, + dns_record_id: str, + *, + zone_id: str, + content: str | object | NotGiven = NOT_GIVEN, + name: str, + type: Literal["A"] + | Literal["AAAA"] + | Literal["CAA"] + | Literal["CERT"] + | Literal["CNAME"] + | Literal["DNSKEY"] + | Literal["DS"] + | Literal["HTTPS"] + | Literal["LOC"] + | Literal["MX"] + | Literal["NAPTR"] + | Literal["NS"] + | Literal["PTR"] + | Literal["SMIMEA"] + | Literal["SRV"] + | Literal["SSHFP"] + | Literal["SVCB"] + | Literal["TLSA"] + | Literal["TXT"] + | Literal["URI"], + comment: str | NotGiven = NOT_GIVEN, + proxied: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + ttl: Union[float, Literal[1]] | NotGiven = NOT_GIVEN, + data: record_edit_params.DNSRecordsCAARecordData + | record_edit_params.DNSRecordsCERTRecordData + | record_edit_params.DNSRecordsDNSKEYRecordData + | record_edit_params.DNSRecordsDSRecordData + | record_edit_params.DNSRecordsHTTPSRecordData + | record_edit_params.DNSRecordsLOCRecordData + | record_edit_params.DNSRecordsNAPTRRecordData + | record_edit_params.DNSRecordsSMIMEARecordData + | record_edit_params.DNSRecordsSRVRecordData + | record_edit_params.DNSRecordsSSHFPRecordData + | record_edit_params.DNSRecordsURIRecordData + | NotGiven = NOT_GIVEN, + priority: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DNSRecord: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not dns_record_id: @@ -1292,16 +8224,15 @@ async def edit( f"/zones/{zone_id}/dns_records/{dns_record_id}", body=await async_maybe_transform( { + "content": content, "name": name, "type": type, "comment": comment, - "content": content, - "data": data, - "meta": meta, - "priority": priority, "proxied": proxied, "tags": tags, "ttl": ttl, + "data": data, + "priority": priority, }, record_edit_params.RecordEditParams, ), diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index 98367d0687a..966f1ef0c82 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, cast +from typing import Any, Type, cast, overload import httpx @@ -40,6 +40,7 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -94,12 +95,12 @@ def with_raw_response(self) -> V1WithRawResponse: def with_streaming_response(self) -> V1WithStreamingResponse: return V1WithStreamingResponse(self) + @overload def create( self, *, account_id: str, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + file: 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, @@ -115,7 +116,7 @@ def create( Args: account_id: Account identifier tag. - require_signed_urls: Indicates whether the image requires a signature token for the access. + file: An image binary data. extra_headers: Send extra headers @@ -125,14 +126,63 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def create( + self, + *, + account_id: str, + url: str, + # 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, + ) -> ImagesImage: + """ + Upload an image with up to 10 Megabytes using a single HTTP POST + (multipart/form-data) request. An image can be uploaded by sending an image file + or passing an accessible to an API url. + + Args: + account_id: Account identifier tag. + + url: A URL to fetch an image from origin. + + 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 + """ + ... + + @required_args(["account_id", "file"], ["account_id", "url"]) + def create( + self, + *, + account_id: str, + file: object | NotGiven = NOT_GIVEN, + url: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImagesImage: 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}/images/v1", body=maybe_transform( { - "metadata": metadata, - "require_signed_urls": require_signed_urls, + "file": file, + "url": url, }, v1_create_params.V1CreateParams, ), @@ -383,12 +433,12 @@ def with_raw_response(self) -> AsyncV1WithRawResponse: def with_streaming_response(self) -> AsyncV1WithStreamingResponse: return AsyncV1WithStreamingResponse(self) + @overload async def create( self, *, account_id: str, - metadata: object | NotGiven = NOT_GIVEN, - require_signed_urls: bool | NotGiven = NOT_GIVEN, + file: 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, @@ -404,7 +454,7 @@ async def create( Args: account_id: Account identifier tag. - require_signed_urls: Indicates whether the image requires a signature token for the access. + file: An image binary data. extra_headers: Send extra headers @@ -414,14 +464,63 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + async def create( + self, + *, + account_id: str, + url: str, + # 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, + ) -> ImagesImage: + """ + Upload an image with up to 10 Megabytes using a single HTTP POST + (multipart/form-data) request. An image can be uploaded by sending an image file + or passing an accessible to an API url. + + Args: + account_id: Account identifier tag. + + url: A URL to fetch an image from origin. + + 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 + """ + ... + + @required_args(["account_id", "file"], ["account_id", "url"]) + async def create( + self, + *, + account_id: str, + file: object | NotGiven = NOT_GIVEN, + url: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ImagesImage: 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}/images/v1", body=await async_maybe_transform( { - "metadata": metadata, - "require_signed_urls": require_signed_urls, + "file": file, + "url": url, }, v1_create_params.V1CreateParams, ), diff --git a/src/cloudflare/resources/pcaps/pcaps.py b/src/cloudflare/resources/pcaps/pcaps.py index 0f78b4092f7..f3f74aabbec 100644 --- a/src/cloudflare/resources/pcaps/pcaps.py +++ b/src/cloudflare/resources/pcaps/pcaps.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Type, Optional, cast, overload from typing_extensions import Literal import httpx @@ -10,6 +10,7 @@ from ...types import PCAPGetResponse, PCAPListResponse, PCAPCreateResponse, pcap_create_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -62,18 +63,16 @@ def with_raw_response(self) -> PCAPsWithRawResponse: def with_streaming_response(self) -> PCAPsWithStreamingResponse: return PCAPsWithStreamingResponse(self) + @overload def create( self, *, account_id: str, + packet_limit: float, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - byte_limit: float | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - filter_v1: pcap_create_params.FilterV1 | NotGiven = NOT_GIVEN, - packet_limit: float | NotGiven = NOT_GIVEN, + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestSimpleFilterV1 | 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 +86,8 @@ def create( Args: account_id: Identifier + packet_limit: The limit of packets contained in a packet capture. + system: The system used to collect packet captures. time_limit: The packet capture duration in seconds. @@ -94,8 +95,43 @@ def create( type: The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet - captures. + filter_v1: The packet capture filter. When this field is empty, all packets are captured. + + 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 create( + self, + *, + account_id: str, + colo_name: str, + destination_conf: str, + system: Literal["magic-transit"], + time_limit: float, + type: Literal["simple", "full"], + byte_limit: float | NotGiven = NOT_GIVEN, + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN, + packet_limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PCAPCreateResponse: + """ + Create new PCAP request for account. + + Args: + account_id: Identifier colo_name: The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` @@ -103,6 +139,18 @@ def create( destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. + system: The system used to collect packet captures. + + time_limit: The packet capture duration in seconds. + + type: The type of packet capture. `Simple` captures sampled packets, and `full` + captures entire payloads and non-sampled packets. + + byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet + captures. + + filter_v1: The packet capture filter. When this field is empty, all packets are captured. + packet_limit: The limit of packets contained in a packet capture. extra_headers: Send extra headers @@ -113,6 +161,31 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["account_id", "packet_limit", "system", "time_limit", "type"], + ["account_id", "colo_name", "destination_conf", "system", "time_limit", "type"], + ) + def create( + self, + *, + account_id: str, + packet_limit: float | NotGiven = NOT_GIVEN, + system: Literal["magic-transit"], + time_limit: float, + type: Literal["simple", "full"], + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, + colo_name: str | NotGiven = NOT_GIVEN, + destination_conf: str | NotGiven = NOT_GIVEN, + byte_limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PCAPCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -121,14 +194,14 @@ def create( f"/accounts/{account_id}/pcaps", body=maybe_transform( { + "packet_limit": packet_limit, "system": system, "time_limit": time_limit, "type": type, - "byte_limit": byte_limit, + "filter_v1": filter_v1, "colo_name": colo_name, "destination_conf": destination_conf, - "filter_v1": filter_v1, - "packet_limit": packet_limit, + "byte_limit": byte_limit, }, pcap_create_params.PCAPCreateParams, ), @@ -251,18 +324,16 @@ def with_raw_response(self) -> AsyncPCAPsWithRawResponse: def with_streaming_response(self) -> AsyncPCAPsWithStreamingResponse: return AsyncPCAPsWithStreamingResponse(self) + @overload async def create( self, *, account_id: str, + packet_limit: float, system: Literal["magic-transit"], time_limit: float, type: Literal["simple", "full"], - byte_limit: float | NotGiven = NOT_GIVEN, - colo_name: str | NotGiven = NOT_GIVEN, - destination_conf: str | NotGiven = NOT_GIVEN, - filter_v1: pcap_create_params.FilterV1 | NotGiven = NOT_GIVEN, - packet_limit: float | NotGiven = NOT_GIVEN, + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestSimpleFilterV1 | 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, @@ -276,6 +347,8 @@ async def create( Args: account_id: Identifier + packet_limit: The limit of packets contained in a packet capture. + system: The system used to collect packet captures. time_limit: The packet capture duration in seconds. @@ -283,8 +356,43 @@ async def create( type: The type of packet capture. `Simple` captures sampled packets, and `full` captures entire payloads and non-sampled packets. - byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet - captures. + filter_v1: The packet capture filter. When this field is empty, all packets are captured. + + 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 create( + self, + *, + account_id: str, + colo_name: str, + destination_conf: str, + system: Literal["magic-transit"], + time_limit: float, + type: Literal["simple", "full"], + byte_limit: float | NotGiven = NOT_GIVEN, + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestFullFilterV1 | NotGiven = NOT_GIVEN, + packet_limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PCAPCreateResponse: + """ + Create new PCAP request for account. + + Args: + account_id: Identifier colo_name: The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` @@ -292,6 +400,18 @@ async def create( destination_conf: The full URI for the bucket. This field only applies to `full` packet captures. + system: The system used to collect packet captures. + + time_limit: The packet capture duration in seconds. + + type: The type of packet capture. `Simple` captures sampled packets, and `full` + captures entire payloads and non-sampled packets. + + byte_limit: The maximum number of bytes to capture. This field only applies to `full` packet + captures. + + filter_v1: The packet capture filter. When this field is empty, all packets are captured. + packet_limit: The limit of packets contained in a packet capture. extra_headers: Send extra headers @@ -302,6 +422,31 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["account_id", "packet_limit", "system", "time_limit", "type"], + ["account_id", "colo_name", "destination_conf", "system", "time_limit", "type"], + ) + async def create( + self, + *, + account_id: str, + packet_limit: float | NotGiven = NOT_GIVEN, + system: Literal["magic-transit"], + time_limit: float, + type: Literal["simple", "full"], + filter_v1: pcap_create_params.MagicVisibilityPCAPsRequestSimpleFilterV1 | NotGiven = NOT_GIVEN, + colo_name: str | NotGiven = NOT_GIVEN, + destination_conf: str | NotGiven = NOT_GIVEN, + byte_limit: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> PCAPCreateResponse: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -310,14 +455,14 @@ async def create( f"/accounts/{account_id}/pcaps", body=await async_maybe_transform( { + "packet_limit": packet_limit, "system": system, "time_limit": time_limit, "type": type, - "byte_limit": byte_limit, + "filter_v1": filter_v1, "colo_name": colo_name, "destination_conf": destination_conf, - "filter_v1": filter_v1, - "packet_limit": packet_limit, + "byte_limit": byte_limit, }, pcap_create_params.PCAPCreateParams, ), diff --git a/src/cloudflare/resources/r2/sippy.py b/src/cloudflare/resources/r2/sippy.py index 515da0642b4..e408938f4cd 100644 --- a/src/cloudflare/resources/r2/sippy.py +++ b/src/cloudflare/resources/r2/sippy.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, cast, overload import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -37,13 +38,14 @@ def with_raw_response(self) -> SippyWithRawResponse: def with_streaming_response(self) -> SippyWithStreamingResponse: return SippyWithStreamingResponse(self) + @overload def update( self, bucket_name: str, *, account_id: str, - destination: sippy_update_params.Destination | NotGiven = NOT_GIVEN, - source: sippy_update_params.Source | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyAwsSource | 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, @@ -59,6 +61,47 @@ def update( bucket_name: Name of the bucket + destination: R2 bucket to copy objects to + + source: AWS S3 bucket to copy objects from + + 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, + bucket_name: str, + *, + account_id: str, + destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> R2Sippy: + """ + Sets configuration for Sippy for an existing R2 bucket. + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + destination: R2 bucket to copy objects to + + source: GCS bucket to copy objects from + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -67,6 +110,25 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id"], ["account_id"]) + def update( + self, + bucket_name: str, + *, + account_id: str, + destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyAwsSource + | sippy_update_params.R2EnableSippyGcsSource + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> R2Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -188,13 +250,14 @@ def with_raw_response(self) -> AsyncSippyWithRawResponse: def with_streaming_response(self) -> AsyncSippyWithStreamingResponse: return AsyncSippyWithStreamingResponse(self) + @overload async def update( self, bucket_name: str, *, account_id: str, - destination: sippy_update_params.Destination | NotGiven = NOT_GIVEN, - source: sippy_update_params.Source | NotGiven = NOT_GIVEN, + destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyAwsSource | 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, @@ -210,6 +273,47 @@ async def update( bucket_name: Name of the bucket + destination: R2 bucket to copy objects to + + source: AWS S3 bucket to copy objects from + + 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, + bucket_name: str, + *, + account_id: str, + destination: sippy_update_params.R2EnableSippyGcsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyGcsSource | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> R2Sippy: + """ + Sets configuration for Sippy for an existing R2 bucket. + + Args: + account_id: Account ID + + bucket_name: Name of the bucket + + destination: R2 bucket to copy objects to + + source: GCS bucket to copy objects from + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -218,6 +322,25 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id"], ["account_id"]) + async def update( + self, + bucket_name: str, + *, + account_id: str, + destination: sippy_update_params.R2EnableSippyAwsDestination | NotGiven = NOT_GIVEN, + source: sippy_update_params.R2EnableSippyAwsSource + | sippy_update_params.R2EnableSippyGcsSource + | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> R2Sippy: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index 77532aab277..aa117100979 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -2,13 +2,15 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, cast, overload +from typing_extensions import Literal import httpx from ...types import RulesetsRulesetResponse from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -38,13 +40,21 @@ def with_raw_response(self) -> RulesWithRawResponse: def with_streaming_response(self) -> RulesWithStreamingResponse: return RulesWithStreamingResponse(self) + @overload def create( self, ruleset_id: str, *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - position: rule_create_params.Position | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsBlockRuleLogging | 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. extra_headers: Headers | None = None, @@ -64,7 +74,898 @@ def create( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - position: An object configuring where the rule will be placed. + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["execute"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsExecuteRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["log"] | NotGiven = NOT_GIVEN, + action_parameters: object | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsLogRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsSkipRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 + """ + ... + + def create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsBlockRuleActionParameters + | rule_create_params.RulesetsExecuteRuleActionParameters + | object + | rule_create_params.RulesetsSkipRuleActionParameters + | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + if not ruleset_id: + raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._post( + f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules", + body=maybe_transform( + { + "id": id, + "action": action, + "action_parameters": action_parameters, + "description": description, + "enabled": enabled, + "expression": expression, + "logging": logging, + "ref": ref, + }, + rule_create_params.RuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + ) + + def delete( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """ + Deletes an existing rule from an account or zone ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not ruleset_id: + raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._delete( + f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + ) + + @overload + def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """ + Updates an existing rule in an account ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["execute"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsExecuteRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """ + Updates an existing rule in an account ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["log"] | NotGiven = NOT_GIVEN, + action_parameters: object | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsLogRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """ + Updates an existing rule in an account ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsSkipRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """ + Updates an existing rule in an account ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 + """ + ... + + @required_args(["ruleset_id"], ["ruleset_id"], ["ruleset_id"], ["ruleset_id"]) + def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters + | rule_edit_params.RulesetsExecuteRuleActionParameters + | object + | rule_edit_params.RulesetsSkipRuleActionParameters + | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + if not ruleset_id: + raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") + if not rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._patch( + f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", + body=maybe_transform( + { + "id": id, + "action": action, + "action_parameters": action_parameters, + "description": description, + "enabled": enabled, + "expression": expression, + "logging": logging, + "ref": ref, + }, + rule_edit_params.RuleEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), + ) + + +class AsyncRules(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRulesWithRawResponse: + return AsyncRulesWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRulesWithStreamingResponse: + return AsyncRulesWithStreamingResponse(self) + + @overload + async def create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["execute"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsExecuteRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["log"] | NotGiven = NOT_GIVEN, + action_parameters: object | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsLogRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + + 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 create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsSkipRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). extra_headers: Send extra headers @@ -74,6 +975,33 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + async def create( + self, + ruleset_id: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_create_params.RulesetsBlockRuleActionParameters + | rule_create_params.RulesetsExecuteRuleActionParameters + | object + | rule_create_params.RulesetsSkipRuleActionParameters + | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_create_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not account_id: @@ -91,9 +1019,21 @@ def create( else: account_or_zone = "zones" account_or_zone_id = zone_id - return self._post( + return await self._post( f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules", - body=maybe_transform({"position": position}, rule_create_params.RuleCreateParams), + body=await async_maybe_transform( + { + "id": id, + "action": action, + "action_parameters": action_parameters, + "description": description, + "enabled": enabled, + "expression": expression, + "logging": logging, + "ref": ref, + }, + rule_create_params.RuleCreateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -104,7 +1044,7 @@ def create( cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), ) - def delete( + async def delete( self, rule_id: str, *, @@ -157,7 +1097,7 @@ def delete( else: account_or_zone = "zones" account_or_zone_id = zone_id - return self._delete( + return await self._delete( f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", options=make_request_options( extra_headers=extra_headers, @@ -169,14 +1109,22 @@ def delete( cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), ) - def edit( + @overload + async def edit( self, rule_id: str, *, ruleset_id: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - position: rule_edit_params.Position | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsBlockRuleLogging | 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. extra_headers: Headers | None = None, @@ -196,7 +1144,21 @@ def edit( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - position: An object configuring where the rule will be placed. + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). extra_headers: Send extra headers @@ -206,55 +1168,24 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if not ruleset_id: - raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._patch( - f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", - body=maybe_transform({"position": position}, rule_edit_params.RuleEditParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), - ) - - -class AsyncRules(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRulesWithRawResponse: - return AsyncRulesWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRulesWithStreamingResponse: - return AsyncRulesWithStreamingResponse(self) + ... - async def create( + @overload + async def edit( self, - ruleset_id: str, + rule_id: str, *, + ruleset_id: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - position: rule_create_params.Position | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["execute"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsExecuteRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsExecuteRuleLogging | 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. extra_headers: Headers | None = None, @@ -262,19 +1193,33 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RulesetsRulesetResponse: - """Adds a new rule to an account or zone ruleset. - - The rule will be added to the end - of the existing list of rules in the ruleset by default. + """ + Updates an existing rule in an account ruleset. Args: ruleset_id: The unique ID of the ruleset. + rule_id: The unique ID of the rule. + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - position: An object configuring where the rule will be placed. + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). extra_headers: Send extra headers @@ -284,43 +1229,24 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not ruleset_id: - raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return await self._post( - f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules", - body=await async_maybe_transform({"position": position}, rule_create_params.RuleCreateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), - ) + ... - async def delete( + @overload + async def edit( self, rule_id: str, *, ruleset_id: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["log"] | NotGiven = NOT_GIVEN, + action_parameters: object | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsLogRuleLogging | 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. extra_headers: Headers | None = None, @@ -329,7 +1255,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> RulesetsRulesetResponse: """ - Deletes an existing rule from an account or zone ruleset. + Updates an existing rule in an account ruleset. Args: ruleset_id: The unique ID of the ruleset. @@ -340,6 +1266,22 @@ async def delete( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -348,37 +1290,9 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if not ruleset_id: - raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if not rule_id: - raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return await self._delete( - f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[RulesetsRulesetResponse], ResultWrapper[RulesetsRulesetResponse]), - ) + ... + @overload async def edit( self, rule_id: str, @@ -386,7 +1300,14 @@ async def edit( ruleset_id: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - position: rule_edit_params.Position | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsSkipRuleActionParameters | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsSkipRuleLogging | 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. extra_headers: Headers | None = None, @@ -406,7 +1327,21 @@ async def edit( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - position: An object configuring where the rule will be placed. + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + ref: The reference of the rule (the rule ID by default). extra_headers: Send extra headers @@ -416,6 +1351,35 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["ruleset_id"], ["ruleset_id"], ["ruleset_id"], ["ruleset_id"]) + async def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + id: str | NotGiven = NOT_GIVEN, + action: Literal["block"] | Literal["execute"] | Literal["log"] | Literal["skip"] | NotGiven = NOT_GIVEN, + action_parameters: rule_edit_params.RulesetsBlockRuleActionParameters + | rule_edit_params.RulesetsExecuteRuleActionParameters + | object + | rule_edit_params.RulesetsSkipRuleActionParameters + | NotGiven = NOT_GIVEN, + description: str | NotGiven = NOT_GIVEN, + enabled: bool | NotGiven = NOT_GIVEN, + expression: str | NotGiven = NOT_GIVEN, + logging: rule_edit_params.RulesetsBlockRuleLogging | 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RulesetsRulesetResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not rule_id: @@ -437,7 +1401,19 @@ async def edit( account_or_zone_id = zone_id return await self._patch( f"/{account_or_zone}/{account_or_zone_id}/rulesets/{ruleset_id}/rules/{rule_id}", - body=await async_maybe_transform({"position": position}, rule_edit_params.RuleEditParams), + body=await async_maybe_transform( + { + "id": id, + "action": action, + "action_parameters": action_parameters, + "description": description, + "enabled": enabled, + "expression": expression, + "logging": logging, + "ref": ref, + }, + rule_edit_params.RuleEditParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/ai.py b/src/cloudflare/resources/workers/ai.py index c4ead45a418..fbdb4390602 100644 --- a/src/cloudflare/resources/workers/ai.py +++ b/src/cloudflare/resources/workers/ai.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing import Any, Optional, cast +from typing import Any, List, Union, Iterable, Optional, cast, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -37,12 +38,13 @@ def with_raw_response(self) -> AIWithRawResponse: def with_streaming_response(self) -> AIWithStreamingResponse: return AIWithStreamingResponse(self) + @overload def run( self, model_name: str, *, account_id: str, - body: ai_run_params.Body, + text: str, # 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, @@ -70,6 +72,615 @@ def run( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @overload + def run( + self, + model_name: str, + *, + account_id: str, + prompt: str, + guidance: float | NotGiven = NOT_GIVEN, + image: Iterable[float] | NotGiven = NOT_GIVEN, + mask: Iterable[float] | NotGiven = NOT_GIVEN, + num_steps: int | NotGiven = NOT_GIVEN, + strength: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + sentences: List[str], + source: str, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + text: Union[str, List[str]], + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + audio: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + image: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + image: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + prompt: str, + lora: str | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + raw: bool | NotGiven = NOT_GIVEN, + stream: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + messages: Iterable[ai_run_params.Variant11Message], + max_tokens: int | NotGiven = NOT_GIVEN, + stream: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + target_lang: str, + text: str, + source_lang: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + input_text: str, + max_length: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + image: Iterable[float] | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + prompt: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 + """ + ... + + @required_args( + ["account_id", "text"], + ["account_id", "prompt"], + ["account_id", "sentences", "source"], + ["account_id", "text"], + ["account_id", "body"], + ["account_id"], + ["account_id", "body"], + ["account_id"], + ["account_id", "body"], + ["account_id"], + ["account_id", "prompt"], + ["account_id", "messages"], + ["account_id", "target_lang", "text"], + ["account_id", "input_text"], + ["account_id", "body"], + ["account_id"], + ) + def run( + self, + model_name: str, + *, + account_id: str, + text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN, + prompt: str | NotGiven = NOT_GIVEN, + guidance: float | NotGiven = NOT_GIVEN, + image: Iterable[float] | NotGiven = NOT_GIVEN, + mask: Iterable[float] | NotGiven = NOT_GIVEN, + num_steps: int | NotGiven = NOT_GIVEN, + strength: float | NotGiven = NOT_GIVEN, + sentences: List[str] | NotGiven = NOT_GIVEN, + source: str | NotGiven = NOT_GIVEN, + body: FileTypes | NotGiven = NOT_GIVEN, + audio: Iterable[float] | NotGiven = NOT_GIVEN, + lora: str | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + raw: bool | NotGiven = NOT_GIVEN, + stream: bool | NotGiven = NOT_GIVEN, + messages: Iterable[ai_run_params.Variant11Message] | NotGiven = NOT_GIVEN, + target_lang: str | NotGiven = NOT_GIVEN, + source_lang: str | NotGiven = NOT_GIVEN, + input_text: str | NotGiven = NOT_GIVEN, + max_length: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not model_name: @@ -78,7 +689,31 @@ def run( Optional[AIRunResponse], self._post( f"/accounts/{account_id}/ai/run/{model_name}", - body=maybe_transform(body, ai_run_params.AIRunParams), + body=maybe_transform( + { + "text": text, + "prompt": prompt, + "guidance": guidance, + "image": image, + "mask": mask, + "num_steps": num_steps, + "strength": strength, + "sentences": sentences, + "source": source, + "body": body, + "audio": audio, + "lora": lora, + "max_tokens": max_tokens, + "raw": raw, + "stream": stream, + "messages": messages, + "target_lang": target_lang, + "source_lang": source_lang, + "input_text": input_text, + "max_length": max_length, + }, + ai_run_params.AIRunParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -93,21 +728,579 @@ def run( ) -class AsyncAI(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAIWithRawResponse: - return AsyncAIWithRawResponse(self) +class AsyncAI(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAIWithRawResponse: + return AsyncAIWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAIWithStreamingResponse: + return AsyncAIWithStreamingResponse(self) + + @overload + async def run( + self, + model_name: str, + *, + account_id: str, + text: str, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + prompt: str, + guidance: float | NotGiven = NOT_GIVEN, + image: Iterable[float] | NotGiven = NOT_GIVEN, + mask: Iterable[float] | NotGiven = NOT_GIVEN, + num_steps: int | NotGiven = NOT_GIVEN, + strength: float | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + sentences: List[str], + source: str, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + text: Union[str, List[str]], + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + audio: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + image: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request - @cached_property - def with_streaming_response(self) -> AsyncAIWithStreamingResponse: - return AsyncAIWithStreamingResponse(self) + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + image: Iterable[float] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + prompt: str, + lora: str | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + raw: bool | NotGiven = NOT_GIVEN, + stream: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + messages: Iterable[ai_run_params.Variant11Message], + max_tokens: int | NotGiven = NOT_GIVEN, + stream: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + target_lang: str, + text: str, + source_lang: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + input_text: str, + max_length: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( + self, + model_name: str, + *, + account_id: str, + body: FileTypes, + # 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[AIRunResponse]: + """ + This endpoint provides users with the capability to run specific AI models + on-demand. + + By submitting the required input data, users can receive real-time predictions + or results generated by the chosen AI model. The endpoint supports various AI + model types, ensuring flexibility and adaptability for diverse use cases. + + Model specific inputs available in + [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + + Args: + 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 run( self, model_name: str, *, account_id: str, - body: ai_run_params.Body, + image: Iterable[float] | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + prompt: 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, @@ -135,6 +1328,58 @@ async def run( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["account_id", "text"], + ["account_id", "prompt"], + ["account_id", "sentences", "source"], + ["account_id", "text"], + ["account_id", "body"], + ["account_id"], + ["account_id", "body"], + ["account_id"], + ["account_id", "body"], + ["account_id"], + ["account_id", "prompt"], + ["account_id", "messages"], + ["account_id", "target_lang", "text"], + ["account_id", "input_text"], + ["account_id", "body"], + ["account_id"], + ) + async def run( + self, + model_name: str, + *, + account_id: str, + text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN, + prompt: str | NotGiven = NOT_GIVEN, + guidance: float | NotGiven = NOT_GIVEN, + image: Iterable[float] | NotGiven = NOT_GIVEN, + mask: Iterable[float] | NotGiven = NOT_GIVEN, + num_steps: int | NotGiven = NOT_GIVEN, + strength: float | NotGiven = NOT_GIVEN, + sentences: List[str] | NotGiven = NOT_GIVEN, + source: str | NotGiven = NOT_GIVEN, + body: FileTypes | NotGiven = NOT_GIVEN, + audio: Iterable[float] | NotGiven = NOT_GIVEN, + lora: str | NotGiven = NOT_GIVEN, + max_tokens: int | NotGiven = NOT_GIVEN, + raw: bool | NotGiven = NOT_GIVEN, + stream: bool | NotGiven = NOT_GIVEN, + messages: Iterable[ai_run_params.Variant11Message] | NotGiven = NOT_GIVEN, + target_lang: str | NotGiven = NOT_GIVEN, + source_lang: str | NotGiven = NOT_GIVEN, + input_text: str | NotGiven = NOT_GIVEN, + max_length: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[AIRunResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not model_name: @@ -143,7 +1388,31 @@ async def run( Optional[AIRunResponse], await self._post( f"/accounts/{account_id}/ai/run/{model_name}", - body=await async_maybe_transform(body, ai_run_params.AIRunParams), + body=await async_maybe_transform( + { + "text": text, + "prompt": prompt, + "guidance": guidance, + "image": image, + "mask": mask, + "num_steps": num_steps, + "strength": strength, + "sentences": sentences, + "source": source, + "body": body, + "audio": audio, + "lora": lora, + "max_tokens": max_tokens, + "raw": raw, + "stream": stream, + "messages": messages, + "target_lang": target_lang, + "source_lang": source_lang, + "input_text": input_text, + "max_length": max_length, + }, + ai_run_params.AIRunParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index 01dc20d49d6..7288195cf54 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, cast, overload import httpx @@ -40,6 +40,7 @@ ) from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes from ...._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -129,6 +130,7 @@ def with_raw_response(self) -> ScriptsWithRawResponse: def with_streaming_response(self) -> ScriptsWithStreamingResponse: return ScriptsWithStreamingResponse(self) + @overload def update( self, script_name: str, @@ -136,8 +138,7 @@ def update( account_id: str, rollback_to: str | NotGiven = NOT_GIVEN, any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - metadata: script_update_params.Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | 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, @@ -161,11 +162,48 @@ def update( may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + + 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, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: + """ + Upload a worker module. + + Args: + account_id: Identifier + + script_name: Name of the script, used in URLs and route configuration. + + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + message: Rollback message to be associated with this deployment. Only parsed when query param `"rollback_to"` is present. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -174,6 +212,25 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id"], ["account_id"]) + def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: @@ -183,8 +240,8 @@ def update( body=maybe_transform( { "any_part_name": any_part_name, - "message": message, "metadata": metadata, + "message": message, }, script_update_params.ScriptUpdateParams, ), @@ -370,6 +427,7 @@ def with_raw_response(self) -> AsyncScriptsWithRawResponse: def with_streaming_response(self) -> AsyncScriptsWithStreamingResponse: return AsyncScriptsWithStreamingResponse(self) + @overload async def update( self, script_name: str, @@ -377,8 +435,7 @@ async def update( account_id: str, rollback_to: str | NotGiven = NOT_GIVEN, any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - metadata: script_update_params.Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | 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, @@ -402,11 +459,48 @@ async def update( may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + + 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, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: + """ + Upload a worker module. + + Args: + account_id: Identifier + + script_name: Name of the script, used in URLs and route configuration. + + rollback_to: Rollback to provided deployment based on deployment ID. Request body will only + parse a "message" part. You can learn more about deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + message: Rollback message to be associated with this deployment. Only parsed when query param `"rollback_to"` is present. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -415,6 +509,25 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id"], ["account_id"]) + async def update( + self, + script_name: str, + *, + account_id: str, + rollback_to: str | NotGiven = NOT_GIVEN, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not script_name: @@ -424,8 +537,8 @@ async def update( body=await async_maybe_transform( { "any_part_name": any_part_name, - "message": message, "metadata": metadata, + "message": message, }, script_update_params.ScriptUpdateParams, ), diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 7fd03d282d5..90ccb7cb50b 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, cast, overload import httpx @@ -16,6 +16,7 @@ ) from ......_types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes from ......_utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -55,6 +56,7 @@ def with_raw_response(self) -> ScriptsWithRawResponse: def with_streaming_response(self) -> ScriptsWithStreamingResponse: return ScriptsWithStreamingResponse(self) + @overload def update( self, script_name: str, @@ -62,8 +64,7 @@ def update( account_id: str, dispatch_namespace: str, any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - metadata: script_update_params.Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | 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, @@ -85,11 +86,46 @@ def update( may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + + 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, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: + """ + Upload a worker module to a Workers for Platforms namespace. + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + message: Rollback message to be associated with this deployment. Only parsed when query param `"rollback_to"` is present. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -98,6 +134,25 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id", "dispatch_namespace"], ["account_id", "dispatch_namespace"]) + def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -109,8 +164,8 @@ def update( body=maybe_transform( { "any_part_name": any_part_name, - "message": message, "metadata": metadata, + "message": message, }, script_update_params.ScriptUpdateParams, ), @@ -244,6 +299,7 @@ def with_raw_response(self) -> AsyncScriptsWithRawResponse: def with_streaming_response(self) -> AsyncScriptsWithStreamingResponse: return AsyncScriptsWithStreamingResponse(self) + @overload async def update( self, script_name: str, @@ -251,8 +307,7 @@ async def update( account_id: str, dispatch_namespace: str, any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, - message: str | NotGiven = NOT_GIVEN, - metadata: script_update_params.Metadata | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | 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, @@ -274,11 +329,46 @@ async def update( may be provided as separate named parts, but at least one module must be present and referenced in the metadata as `main_module` or `body_part` by part name. + metadata: JSON encoded metadata about the uploaded parts and Worker configuration. + + 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, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: + """ + Upload a worker module to a Workers for Platforms namespace. + + Args: + account_id: Identifier + + dispatch_namespace: Name of the Workers for Platforms dispatch namespace. + + script_name: Name of the script, used in URLs and route configuration. + message: Rollback message to be associated with this deployment. Only parsed when query param `"rollback_to"` is present. - metadata: JSON encoded metadata about the uploaded parts and Worker configuration. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -287,6 +377,25 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args(["account_id", "dispatch_namespace"], ["account_id", "dispatch_namespace"]) + async def update( + self, + script_name: str, + *, + account_id: str, + dispatch_namespace: str, + any_part_name: List[FileTypes] | NotGiven = NOT_GIVEN, + metadata: script_update_params.Variant0Metadata | NotGiven = NOT_GIVEN, + message: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> WorkersScript: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -298,8 +407,8 @@ async def update( body=await async_maybe_transform( { "any_part_name": any_part_name, - "message": message, "metadata": metadata, + "message": message, }, script_update_params.ScriptUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index 7b2064c0dd3..93dfa829dca 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Type, Union, Optional, cast +from typing import Any, List, Type, Union, Optional, cast, overload from typing_extensions import Literal import httpx @@ -80,35 +80,34 @@ def with_raw_response(self) -> ApplicationsWithRawResponse: def with_streaming_response(self) -> ApplicationsWithStreamingResponse: return ApplicationsWithStreamingResponse(self) + @overload def create( self, *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, allowed_idps: List[str] | NotGiven = NOT_GIVEN, - app_launcher_visible: object | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: application_create_params.CorsHeaders | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, custom_deny_message: str | NotGiven = NOT_GIVEN, custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, - domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaasApp | NotGiven = NOT_GIVEN, same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - | 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, @@ -120,6 +119,11 @@ def create( Adds a new application to Access. Args: + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -132,6 +136,8 @@ def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. + app_launcher_visible: Displays the application in the App Launcher. + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. @@ -146,8 +152,6 @@ def create( custom_pages: The custom pages that will be displayed when applicable for this application - domain: The URL or domain of the bookmark. - enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -174,6 +178,63 @@ def create( skip_interstitial: Enables automatic authentication through cloudflared. + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 create( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + saas_app: application_create_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_pages: The custom pages that will be displayed when applicable for this application + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -187,96 +248,36 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessApps, - self._post( - f"/{account_or_zone}/{account_or_zone_id}/access/apps", - body=maybe_transform( - { - "allow_authenticate_via_warp": allow_authenticate_via_warp, - "allowed_idps": allowed_idps, - "app_launcher_visible": app_launcher_visible, - "auto_redirect_to_identity": auto_redirect_to_identity, - "cors_headers": cors_headers, - "custom_deny_message": custom_deny_message, - "custom_deny_url": custom_deny_url, - "custom_non_identity_deny_url": custom_non_identity_deny_url, - "custom_pages": custom_pages, - "domain": domain, - "enable_binding_cookie": enable_binding_cookie, - "http_only_cookie_attribute": http_only_cookie_attribute, - "logo_url": logo_url, - "name": name, - "path_cookie_attribute": path_cookie_attribute, - "saas_app": saas_app, - "same_site_cookie_attribute": same_site_cookie_attribute, - "self_hosted_domains": self_hosted_domains, - "service_auth_401_redirect": service_auth_401_redirect, - "session_duration": session_duration, - "skip_interstitial": skip_interstitial, - "tags": tags, - "type": type, - }, - application_create_params.ApplicationCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessApps] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def update( + @overload + def create( self, - app_id: Union[str, str], *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, allowed_idps: List[str] | NotGiven = NOT_GIVEN, - app_launcher_visible: object | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: application_update_params.CorsHeaders | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.BrowserSSHApplicationCorsHeaders | NotGiven = NOT_GIVEN, custom_deny_message: str | NotGiven = NOT_GIVEN, custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, - domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaasApp | NotGiven = NOT_GIVEN, same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - | 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, @@ -285,10 +286,13 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccessApps: """ - Updates an Access application. + Adds a new application to Access. Args: - app_id: Identifier + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. @@ -302,6 +306,8 @@ def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. + app_launcher_visible: Displays the application in the App Launcher. + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. @@ -316,8 +322,6 @@ def update( custom_pages: The custom pages that will be displayed when applicable for this application - domain: The URL or domain of the bookmark. - enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -347,8 +351,6 @@ def update( tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. - type: The application type. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -357,143 +359,2145 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessApps, - self._put( - f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", - body=maybe_transform( - { - "allow_authenticate_via_warp": allow_authenticate_via_warp, - "allowed_idps": allowed_idps, - "app_launcher_visible": app_launcher_visible, - "auto_redirect_to_identity": auto_redirect_to_identity, - "cors_headers": cors_headers, - "custom_deny_message": custom_deny_message, - "custom_deny_url": custom_deny_url, - "custom_non_identity_deny_url": custom_non_identity_deny_url, - "custom_pages": custom_pages, - "domain": domain, - "enable_binding_cookie": enable_binding_cookie, - "http_only_cookie_attribute": http_only_cookie_attribute, - "logo_url": logo_url, - "name": name, - "path_cookie_attribute": path_cookie_attribute, - "saas_app": saas_app, - "same_site_cookie_attribute": same_site_cookie_attribute, - "self_hosted_domains": self_hosted_domains, - "service_auth_401_redirect": service_auth_401_redirect, - "session_duration": session_duration, - "skip_interstitial": skip_interstitial, - "tags": tags, - "type": type, - }, - application_update_params.ApplicationUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessApps] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... - def list( + @overload + def create( self, *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.BrowserVncApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[ApplicationListResponse]: + ) -> AccessApps: """ - Lists all Access applications in an account or zone. + Adds a new application to Access. Args: + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - extra_headers: Send extra headers + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. - extra_query: Add additional query parameters to the request + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. - extra_body: Add additional JSON properties to the request + app_launcher_visible: Displays the application in the App Launcher. - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._get( - f"/{account_or_zone}/{account_or_zone_id}/access/apps", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + app_launcher_visible: object | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + domain: The URL or domain of the bookmark. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + type: The application type. + + 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 + """ + ... + + def create( + self, + *, + domain: str | object | NotGiven = NOT_GIVEN, + type: str + | Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | object | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + saas_app: application_create_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessApps, + self._post( + f"/{account_or_zone}/{account_or_zone_id}/access/apps", + body=maybe_transform( + { + "domain": domain, + "type": type, + "allow_authenticate_via_warp": allow_authenticate_via_warp, + "allowed_idps": allowed_idps, + "app_launcher_visible": app_launcher_visible, + "auto_redirect_to_identity": auto_redirect_to_identity, + "cors_headers": cors_headers, + "custom_deny_message": custom_deny_message, + "custom_deny_url": custom_deny_url, + "custom_non_identity_deny_url": custom_non_identity_deny_url, + "custom_pages": custom_pages, + "enable_binding_cookie": enable_binding_cookie, + "http_only_cookie_attribute": http_only_cookie_attribute, + "logo_url": logo_url, + "name": name, + "path_cookie_attribute": path_cookie_attribute, + "same_site_cookie_attribute": same_site_cookie_attribute, + "self_hosted_domains": self_hosted_domains, + "service_auth_401_redirect": service_auth_401_redirect, + "session_duration": session_duration, + "skip_interstitial": skip_interstitial, + "tags": tags, + "saas_app": saas_app, + }, + application_create_params.ApplicationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessApps] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + @overload + def update( + self, + app_id: Union[str, str], + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + saas_app: application_update_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_pages: The custom pages that will be displayed when applicable for this application + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + type: The application type. + + 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, + app_id: Union[str, str], + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.BrowserSSHApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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, + app_id: Union[str, str], + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.BrowserVncApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + app_launcher_visible: object | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + domain: The URL or domain of the bookmark. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + type: The application type. + + 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 + """ + ... + + def update( + self, + app_id: Union[str, str], + *, + domain: str | object | NotGiven = NOT_GIVEN, + type: str + | Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | object | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + saas_app: application_update_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessApps, + self._put( + f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", + body=maybe_transform( + { + "domain": domain, + "type": type, + "allow_authenticate_via_warp": allow_authenticate_via_warp, + "allowed_idps": allowed_idps, + "app_launcher_visible": app_launcher_visible, + "auto_redirect_to_identity": auto_redirect_to_identity, + "cors_headers": cors_headers, + "custom_deny_message": custom_deny_message, + "custom_deny_url": custom_deny_url, + "custom_non_identity_deny_url": custom_non_identity_deny_url, + "custom_pages": custom_pages, + "enable_binding_cookie": enable_binding_cookie, + "http_only_cookie_attribute": http_only_cookie_attribute, + "logo_url": logo_url, + "name": name, + "path_cookie_attribute": path_cookie_attribute, + "same_site_cookie_attribute": same_site_cookie_attribute, + "self_hosted_domains": self_hosted_domains, + "service_auth_401_redirect": service_auth_401_redirect, + "session_duration": session_duration, + "skip_interstitial": skip_interstitial, + "tags": tags, + "saas_app": saas_app, + }, + application_update_params.ApplicationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessApps] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[ApplicationListResponse]: + """ + Lists all Access applications in an account or zone. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/access/apps", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[Optional[ApplicationListResponse]], ResultWrapper[ApplicationListResponse]), + ) + + def delete( + self, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ApplicationDeleteResponse: + """ + Deletes an application from Access. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._delete( + f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[ApplicationDeleteResponse], ResultWrapper[ApplicationDeleteResponse]), + ) + + def get( + self, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Fetches information about an Access application. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessApps, + self._get( + f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessApps] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def revoke_tokens( + self, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Revokes all tokens issued for an application. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._post( + f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/revoke_tokens", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + +class AsyncApplications(AsyncAPIResource): + @cached_property + def cas(self) -> AsyncCAs: + return AsyncCAs(self._client) + + @cached_property + def user_policy_checks(self) -> AsyncUserPolicyChecks: + return AsyncUserPolicyChecks(self._client) + + @cached_property + def policies(self) -> AsyncPolicies: + return AsyncPolicies(self._client) + + @cached_property + def with_raw_response(self) -> AsyncApplicationsWithRawResponse: + return AsyncApplicationsWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncApplicationsWithStreamingResponse: + return AsyncApplicationsWithStreamingResponse(self) + + @overload + async def create( + self, + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 create( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + saas_app: application_create_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_pages: The custom pages that will be displayed when applicable for this application + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + type: The application type. + + 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 create( + self, + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.BrowserSSHApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 create( + self, + *, + domain: str, + type: str, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.BrowserVncApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + app_launcher_visible: object | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Adds a new application to Access. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + domain: The URL or domain of the bookmark. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + type: The application type. + + 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 + """ + ... + + async def create( + self, + *, + domain: str | object | NotGiven = NOT_GIVEN, + type: str + | Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | object | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_create_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + saas_app: application_create_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessApps, + await self._post( + f"/{account_or_zone}/{account_or_zone_id}/access/apps", + body=await async_maybe_transform( + { + "domain": domain, + "type": type, + "allow_authenticate_via_warp": allow_authenticate_via_warp, + "allowed_idps": allowed_idps, + "app_launcher_visible": app_launcher_visible, + "auto_redirect_to_identity": auto_redirect_to_identity, + "cors_headers": cors_headers, + "custom_deny_message": custom_deny_message, + "custom_deny_url": custom_deny_url, + "custom_non_identity_deny_url": custom_non_identity_deny_url, + "custom_pages": custom_pages, + "enable_binding_cookie": enable_binding_cookie, + "http_only_cookie_attribute": http_only_cookie_attribute, + "logo_url": logo_url, + "name": name, + "path_cookie_attribute": path_cookie_attribute, + "same_site_cookie_attribute": same_site_cookie_attribute, + "self_hosted_domains": self_hosted_domains, + "service_auth_401_redirect": service_auth_401_redirect, + "session_duration": session_duration, + "skip_interstitial": skip_interstitial, + "tags": tags, + "saas_app": saas_app, + }, + application_create_params.ApplicationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessApps] + ), # Union types cannot be passed in as arguments in the type system ), - cast_to=cast(Type[Optional[ApplicationListResponse]], ResultWrapper[ApplicationListResponse]), ) - def delete( + @overload + async def update( self, app_id: Union[str, str], *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: 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, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ApplicationDeleteResponse: + ) -> AccessApps: """ - Deletes an application from Access. + Updates an Access application. Args: app_id: Identifier - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + app_launcher_visible: Displays the application in the App Launcher. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + enable_binding_cookie: Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + path_cookie_attribute: Enables cookie paths to scope an application's JWT to the application path. If + disabled, the JWT will scope to the hostname by default + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. - zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. extra_headers: Send extra headers @@ -503,39 +2507,24 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._delete( - f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[ApplicationDeleteResponse], ResultWrapper[ApplicationDeleteResponse]), - ) + ... - def get( + @overload + async def update( self, app_id: Union[str, str], *, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + saas_app: application_update_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + tags: List[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, @@ -544,7 +2533,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccessApps: """ - Fetches information about an Access application. + Updates an Access application. Args: app_id: Identifier @@ -553,68 +2542,24 @@ def get( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. - extra_body: Add additional JSON properties to the request + app_launcher_visible: Displays the application in the App Launcher. - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessApps, - self._get( - f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessApps] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + custom_pages: The custom pages that will be displayed when applicable for this application - def revoke_tokens( - self, - app_id: Union[str, str], - *, - account_id: str | NotGiven = NOT_GIVEN, - zone_id: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Revokes all tokens issued for an application. + logo_url: The image URL for the logo shown in the App Launcher dashboard. - Args: - app_id: Identifier + name: The name of the application. - account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. - zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + type: The application type. extra_headers: Send extra headers @@ -624,84 +2569,37 @@ def revoke_tokens( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._post( - f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}/revoke_tokens", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[object], ResultWrapper[object]), - ) - - -class AsyncApplications(AsyncAPIResource): - @cached_property - def cas(self) -> AsyncCAs: - return AsyncCAs(self._client) - - @cached_property - def user_policy_checks(self) -> AsyncUserPolicyChecks: - return AsyncUserPolicyChecks(self._client) - - @cached_property - def policies(self) -> AsyncPolicies: - return AsyncPolicies(self._client) - - @cached_property - def with_raw_response(self) -> AsyncApplicationsWithRawResponse: - return AsyncApplicationsWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncApplicationsWithStreamingResponse: - return AsyncApplicationsWithStreamingResponse(self) + ... - async def create( + @overload + async def update( self, + app_id: Union[str, str], *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, allowed_idps: List[str] | NotGiven = NOT_GIVEN, - app_launcher_visible: object | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: application_create_params.CorsHeaders | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.BrowserSSHApplicationCorsHeaders | NotGiven = NOT_GIVEN, custom_deny_message: str | NotGiven = NOT_GIVEN, custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, - domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - saas_app: application_create_params.SaasApp | NotGiven = NOT_GIVEN, same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - | 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, @@ -710,9 +2608,16 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccessApps: """ - Adds a new application to Access. + Updates an Access application. Args: + app_id: Identifier + + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -725,6 +2630,8 @@ async def create( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. + app_launcher_visible: Displays the application in the App Launcher. + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. @@ -739,8 +2646,6 @@ async def create( custom_pages: The custom pages that will be displayed when applicable for this application - domain: The URL or domain of the bookmark. - enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -757,119 +2662,58 @@ async def create( same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF attacks. - self_hosted_domains: List of domains that Access will secure. - - service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. - - session_duration: The amount of time that tokens issued for this application will be valid. Must - be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, - s, m, h. - - skip_interstitial: Enables automatic authentication through cloudflared. - - tags: The tags you want assigned to an application. Tags are used to filter - applications in the App Launcher dashboard. - - type: The application type. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessApps, - await self._post( - f"/{account_or_zone}/{account_or_zone_id}/access/apps", - body=await async_maybe_transform( - { - "allow_authenticate_via_warp": allow_authenticate_via_warp, - "allowed_idps": allowed_idps, - "app_launcher_visible": app_launcher_visible, - "auto_redirect_to_identity": auto_redirect_to_identity, - "cors_headers": cors_headers, - "custom_deny_message": custom_deny_message, - "custom_deny_url": custom_deny_url, - "custom_non_identity_deny_url": custom_non_identity_deny_url, - "custom_pages": custom_pages, - "domain": domain, - "enable_binding_cookie": enable_binding_cookie, - "http_only_cookie_attribute": http_only_cookie_attribute, - "logo_url": logo_url, - "name": name, - "path_cookie_attribute": path_cookie_attribute, - "saas_app": saas_app, - "same_site_cookie_attribute": same_site_cookie_attribute, - "self_hosted_domains": self_hosted_domains, - "service_auth_401_redirect": service_auth_401_redirect, - "session_duration": session_duration, - "skip_interstitial": skip_interstitial, - "tags": tags, - "type": type, - }, - application_create_params.ApplicationCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessApps] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + self_hosted_domains: List of domains that Access will secure. + + service_auth_401_redirect: Returns a 401 status code when the request is blocked by a Service Auth policy. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. + + skip_interstitial: Enables automatic authentication through cloudflared. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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, app_id: Union[str, str], *, + domain: str, + type: str, account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, allowed_idps: List[str] | NotGiven = NOT_GIVEN, - app_launcher_visible: object | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | NotGiven = NOT_GIVEN, auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, - cors_headers: application_update_params.CorsHeaders | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.BrowserVncApplicationCorsHeaders | NotGiven = NOT_GIVEN, custom_deny_message: str | NotGiven = NOT_GIVEN, custom_deny_url: str | NotGiven = NOT_GIVEN, custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, custom_pages: List[str] | NotGiven = NOT_GIVEN, - domain: object | NotGiven = NOT_GIVEN, enable_binding_cookie: bool | NotGiven = NOT_GIVEN, http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, logo_url: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, path_cookie_attribute: bool | NotGiven = NOT_GIVEN, - saas_app: application_update_params.SaasApp | NotGiven = NOT_GIVEN, same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, session_duration: str | NotGiven = NOT_GIVEN, skip_interstitial: bool | NotGiven = NOT_GIVEN, tags: List[str] | NotGiven = NOT_GIVEN, - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - | 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, @@ -883,6 +2727,11 @@ async def update( Args: app_id: Identifier + domain: The primary hostname and path that Access will secure. If the app is visible in + the App Launcher dashboard, this is the domain that will be displayed. + + type: The application type. + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. @@ -895,6 +2744,8 @@ async def update( allowed_idps: The identity providers your users can select when connecting to this application. Defaults to all IdPs configured in your account. + app_launcher_visible: Displays the application in the App Launcher. + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during login. You must specify only one identity provider in allowed_idps. @@ -909,8 +2760,6 @@ async def update( custom_pages: The custom pages that will be displayed when applicable for this application - domain: The URL or domain of the bookmark. - enable_binding_cookie: Enables the binding cookie, which increases security against compromised authorization tokens and CSRF attacks. @@ -937,6 +2786,205 @@ async def update( skip_interstitial: Enables automatic authentication through cloudflared. + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + session_duration: The amount of time that tokens issued for this 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 + + 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, + app_id: Union[str, str], + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + app_launcher_visible: object | NotGiven = NOT_GIVEN, + domain: object | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + tags: List[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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: + """ + Updates an Access application. + + Args: + app_id: Identifier + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + domain: The URL or domain of the bookmark. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + tags: The tags you want assigned to an application. Tags are used to filter applications in the App Launcher dashboard. @@ -950,6 +2998,46 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + async def update( + self, + app_id: Union[str, str], + *, + domain: str | object | NotGiven = NOT_GIVEN, + type: str + | Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] + | NotGiven = NOT_GIVEN, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + allow_authenticate_via_warp: bool | NotGiven = NOT_GIVEN, + allowed_idps: List[str] | NotGiven = NOT_GIVEN, + app_launcher_visible: bool | object | NotGiven = NOT_GIVEN, + auto_redirect_to_identity: bool | NotGiven = NOT_GIVEN, + cors_headers: application_update_params.SelfHostedApplicationCorsHeaders | NotGiven = NOT_GIVEN, + custom_deny_message: str | NotGiven = NOT_GIVEN, + custom_deny_url: str | NotGiven = NOT_GIVEN, + custom_non_identity_deny_url: str | NotGiven = NOT_GIVEN, + custom_pages: List[str] | NotGiven = NOT_GIVEN, + enable_binding_cookie: bool | NotGiven = NOT_GIVEN, + http_only_cookie_attribute: bool | NotGiven = NOT_GIVEN, + logo_url: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + path_cookie_attribute: bool | NotGiven = NOT_GIVEN, + same_site_cookie_attribute: str | NotGiven = NOT_GIVEN, + self_hosted_domains: List[str] | NotGiven = NOT_GIVEN, + service_auth_401_redirect: bool | NotGiven = NOT_GIVEN, + session_duration: str | NotGiven = NOT_GIVEN, + skip_interstitial: bool | NotGiven = NOT_GIVEN, + tags: List[str] | NotGiven = NOT_GIVEN, + saas_app: application_update_params.SaaSApplicationSaasApp | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessApps: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not zone_id: @@ -971,6 +3059,8 @@ async def update( f"/{account_or_zone}/{account_or_zone_id}/access/apps/{app_id}", body=await async_maybe_transform( { + "domain": domain, + "type": type, "allow_authenticate_via_warp": allow_authenticate_via_warp, "allowed_idps": allowed_idps, "app_launcher_visible": app_launcher_visible, @@ -980,20 +3070,18 @@ async def update( "custom_deny_url": custom_deny_url, "custom_non_identity_deny_url": custom_non_identity_deny_url, "custom_pages": custom_pages, - "domain": domain, "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, "name": name, "path_cookie_attribute": path_cookie_attribute, - "saas_app": saas_app, "same_site_cookie_attribute": same_site_cookie_attribute, "self_hosted_domains": self_hosted_domains, "service_auth_401_redirect": service_auth_401_redirect, "session_duration": session_duration, "skip_interstitial": skip_interstitial, "tags": tags, - "type": type, + "saas_app": saas_app, }, application_update_params.ApplicationUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/identity_providers.py b/src/cloudflare/resources/zero_trust/identity_providers.py index 849acd8809f..e8719f6a7a2 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Any, Type, Optional, cast +from typing import Any, Type, Optional, cast, overload from typing_extensions import Literal import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( + required_args, maybe_transform, async_maybe_transform, ) @@ -44,10 +45,11 @@ def with_raw_response(self) -> IdentityProvidersWithRawResponse: def with_streaming_response(self) -> IdentityProvidersWithStreamingResponse: return IdentityProvidersWithStreamingResponse(self) + @overload def create( self, *, - config: identity_provider_create_params.Config, + config: identity_provider_create_params.AccessAzureAdConfig, name: str, type: Literal[ "onetimepin", @@ -67,7 +69,7 @@ def create( ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - scim_config: identity_provider_create_params.ScimConfig | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessAzureAdScimConfig | 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, @@ -79,6 +81,3518 @@ def create( Adds a new identity provider to Access. Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessCentrifyConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessCentrifyScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessFacebookConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessFacebookScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGitHubConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGitHubScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGoogleConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGoogleScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGoogleAppsConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGoogleAppsScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessLinkedinConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessLinkedinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOidcConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOidcScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOktaConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOktaScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOneloginConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOneloginScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessPingoneConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessPingoneScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessSamlConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessSamlScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessYandexConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessYandexScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOnetimepinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 + """ + ... + + @required_args( + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ) + def create( + self, + *, + config: identity_provider_create_params.AccessAzureAdConfig + | identity_provider_create_params.AccessCentrifyConfig + | identity_provider_create_params.AccessFacebookConfig + | identity_provider_create_params.AccessGoogleConfig + | identity_provider_create_params.AccessGoogleAppsConfig + | identity_provider_create_params.AccessOidcConfig + | identity_provider_create_params.AccessOktaConfig + | identity_provider_create_params.AccessOneloginConfig + | identity_provider_create_params.AccessPingoneConfig + | identity_provider_create_params.AccessSamlConfig + | object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessIdentityProviders, + self._post( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", + body=maybe_transform( + { + "config": config, + "name": name, + "type": type, + "scim_config": scim_config, + }, + identity_provider_create_params.IdentityProviderCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessIdentityProviders] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + @overload + def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessAzureAdConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessCentrifyConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessCentrifyScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessFacebookConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessFacebookScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGitHubConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGitHubScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGoogleConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGoogleScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGoogleAppsConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGoogleAppsScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessLinkedinConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessLinkedinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessOidcConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOidcScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessOktaConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOktaScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessOneloginConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOneloginScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessPingoneConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessPingoneScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessSamlConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessSamlScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessYandexConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessYandexScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOnetimepinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 + """ + ... + + @required_args( + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ) + def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessAzureAdConfig + | identity_provider_update_params.AccessCentrifyConfig + | identity_provider_update_params.AccessFacebookConfig + | identity_provider_update_params.AccessGoogleConfig + | identity_provider_update_params.AccessGoogleAppsConfig + | identity_provider_update_params.AccessOidcConfig + | identity_provider_update_params.AccessOktaConfig + | identity_provider_update_params.AccessOneloginConfig + | identity_provider_update_params.AccessPingoneConfig + | identity_provider_update_params.AccessSamlConfig + | object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessIdentityProviders, + self._put( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", + body=maybe_transform( + { + "config": config, + "name": name, + "type": type, + "scim_config": scim_config, + }, + identity_provider_update_params.IdentityProviderUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessIdentityProviders] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def list( + self, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Optional[IdentityProviderListResponse]: + """ + Lists all configured identity providers. + + Args: + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._get( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[Optional[IdentityProviderListResponse]], ResultWrapper[IdentityProviderListResponse]), + ) + + def delete( + self, + uuid: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> IdentityProviderDeleteResponse: + """ + Deletes an identity provider from Access. + + Args: + uuid: UUID + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return self._delete( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast(Type[IdentityProviderDeleteResponse], ResultWrapper[IdentityProviderDeleteResponse]), + ) + + def get( + self, + uuid: str, + *, + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Fetches a configured identity provider. + + Args: + uuid: UUID + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessIdentityProviders, + self._get( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessIdentityProviders] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncIdentityProviders(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncIdentityProvidersWithRawResponse: + return AsyncIdentityProvidersWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncIdentityProvidersWithStreamingResponse: + return AsyncIdentityProvidersWithStreamingResponse(self) + + @overload + async def create( + self, + *, + config: identity_provider_create_params.AccessAzureAdConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessCentrifyConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessCentrifyScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessFacebookConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessFacebookScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGitHubConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGitHubScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGoogleConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGoogleScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessGoogleAppsConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessGoogleAppsScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessLinkedinConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessLinkedinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOidcConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOidcScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOktaConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOktaScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessOneloginConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOneloginScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessPingoneConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessPingoneScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessSamlConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessSamlScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: identity_provider_create_params.AccessYandexConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessYandexScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 create( + self, + *, + config: object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessOnetimepinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Adds a new identity provider to Access. + + Args: + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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 + """ + ... + + @required_args( + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ) + async def create( + self, + *, + config: identity_provider_create_params.AccessAzureAdConfig + | identity_provider_create_params.AccessCentrifyConfig + | identity_provider_create_params.AccessFacebookConfig + | identity_provider_create_params.AccessGoogleConfig + | identity_provider_create_params.AccessGoogleAppsConfig + | identity_provider_create_params.AccessOidcConfig + | identity_provider_create_params.AccessOktaConfig + | identity_provider_create_params.AccessOneloginConfig + | identity_provider_create_params.AccessPingoneConfig + | identity_provider_create_params.AccessSamlConfig + | object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_create_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not account_id and not zone_id: + raise ValueError("You must provide either account_id or zone_id") + if account_id and zone_id: + raise ValueError("You cannot provide both account_id and zone_id") + + if account_id: + account_or_zone = "accounts" + account_or_zone_id = account_id + else: + account_or_zone = "zones" + account_or_zone_id = zone_id + return cast( + AccessIdentityProviders, + await self._post( + f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", + body=await async_maybe_transform( + { + "config": config, + "name": name, + "type": type, + "scim_config": scim_config, + }, + identity_provider_create_params.IdentityProviderCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccessIdentityProviders] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + @overload + async def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessAzureAdConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessCentrifyConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessCentrifyScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessFacebookConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessFacebookScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGitHubConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGitHubScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGoogleConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGoogleScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, + *, + config: identity_provider_update_params.AccessGoogleAppsConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessGoogleAppsScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. + + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + name: The name of the identity provider, shown to users on the login page. type: The type of identity provider. To determine the value for a specific provider, @@ -89,6 +3603,9 @@ def create( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -97,52 +3614,80 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") + ... - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessIdentityProviders, - self._post( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", - body=maybe_transform( - { - "config": config, - "name": name, - "type": type, - "scim_config": scim_config, - }, - identity_provider_create_params.IdentityProviderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessIdentityProviders] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + @overload + async def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessLinkedinConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessLinkedinScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. - def update( + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, uuid: str, *, - config: identity_provider_update_params.Config, + config: identity_provider_update_params.AccessOidcConfig, name: str, type: Literal[ "onetimepin", @@ -162,7 +3707,7 @@ def update( ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - scim_config: identity_provider_update_params.ScimConfig | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOidcScimConfig | 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, @@ -176,6 +3721,10 @@ def update( Args: uuid: UUID + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + name: The name of the identity provider, shown to users on the login page. type: The type of identity provider. To determine the value for a specific provider, @@ -186,6 +3735,9 @@ def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -194,69 +3746,130 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") + ... - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessIdentityProviders, - self._put( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", - body=maybe_transform( - { - "config": config, - "name": name, - "type": type, - "scim_config": scim_config, - }, - identity_provider_update_params.IdentityProviderUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessIdentityProviders] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + @overload + async def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessOktaConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOktaScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: + """ + Updates a configured identity provider. - def list( + Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + + 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, + uuid: str, *, + config: identity_provider_update_params.AccessOneloginConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOneloginScimConfig | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[IdentityProviderListResponse]: + ) -> AccessIdentityProviders: """ - Lists all configured identity providers. + Updates a configured identity provider. Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -265,56 +3878,64 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._get( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[Optional[IdentityProviderListResponse]], ResultWrapper[IdentityProviderListResponse]), - ) + ... - def delete( + @overload + async def update( self, uuid: str, *, + config: identity_provider_update_params.AccessPingoneConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessPingoneScimConfig | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> IdentityProviderDeleteResponse: + ) -> AccessIdentityProviders: """ - Deletes an identity provider from Access. + Updates a configured identity provider. Args: uuid: UUID + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -323,41 +3944,34 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return self._delete( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast(Type[IdentityProviderDeleteResponse], ResultWrapper[IdentityProviderDeleteResponse]), - ) + ... - def get( + @overload + async def update( self, uuid: str, *, + config: identity_provider_update_params.AccessSamlConfig, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessSamlScimConfig | 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, @@ -366,15 +3980,28 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccessIdentityProviders: """ - Fetches a configured identity provider. + Updates a configured identity provider. Args: uuid: UUID + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + + name: The name of the identity provider, shown to users on the login page. + + type: The type of identity provider. To determine the value for a specific provider, + refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -383,54 +4010,14 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessIdentityProviders, - self._get( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers/{uuid}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessIdentityProviders] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncIdentityProviders(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncIdentityProvidersWithRawResponse: - return AsyncIdentityProvidersWithRawResponse(self) + ... - @cached_property - def with_streaming_response(self) -> AsyncIdentityProvidersWithStreamingResponse: - return AsyncIdentityProvidersWithStreamingResponse(self) - - async def create( + @overload + async def update( self, + uuid: str, *, - config: identity_provider_create_params.Config, + config: identity_provider_update_params.AccessYandexConfig, name: str, type: Literal[ "onetimepin", @@ -450,7 +4037,7 @@ async def create( ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - scim_config: identity_provider_create_params.ScimConfig | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessYandexScimConfig | 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, @@ -459,9 +4046,15 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AccessIdentityProviders: """ - Adds a new identity provider to Access. + Updates a configured identity provider. Args: + uuid: UUID + + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + name: The name of the identity provider, shown to users on the login page. type: The type of identity provider. To determine the value for a specific provider, @@ -472,6 +4065,9 @@ async def create( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -480,52 +4076,14 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if not account_id: - raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if not account_id and not zone_id: - raise ValueError("You must provide either account_id or zone_id") - if account_id and zone_id: - raise ValueError("You cannot provide both account_id and zone_id") - - if account_id: - account_or_zone = "accounts" - account_or_zone_id = account_id - else: - account_or_zone = "zones" - account_or_zone_id = zone_id - return cast( - AccessIdentityProviders, - await self._post( - f"/{account_or_zone}/{account_or_zone_id}/access/identity_providers", - body=await async_maybe_transform( - { - "config": config, - "name": name, - "type": type, - "scim_config": scim_config, - }, - identity_provider_create_params.IdentityProviderCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[AccessIdentityProviders] - ), # Union types cannot be passed in as arguments in the type system - ), - ) + ... + @overload async def update( self, uuid: str, *, - config: identity_provider_update_params.Config, + config: object, name: str, type: Literal[ "onetimepin", @@ -545,7 +4103,7 @@ async def update( ], account_id: str | NotGiven = NOT_GIVEN, zone_id: str | NotGiven = NOT_GIVEN, - scim_config: identity_provider_update_params.ScimConfig | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessOnetimepinScimConfig | 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, @@ -559,6 +4117,10 @@ async def update( Args: uuid: UUID + config: The configuration parameters for the identity provider. To view the required + parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + name: The name of the identity provider, shown to users on the login page. type: The type of identity provider. To determine the value for a specific provider, @@ -569,6 +4131,9 @@ async def update( zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + scim_config: The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -577,6 +4142,66 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ + ... + + @required_args( + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ["config", "name", "type"], + ) + async def update( + self, + uuid: str, + *, + config: identity_provider_update_params.AccessAzureAdConfig + | identity_provider_update_params.AccessCentrifyConfig + | identity_provider_update_params.AccessFacebookConfig + | identity_provider_update_params.AccessGoogleConfig + | identity_provider_update_params.AccessGoogleAppsConfig + | identity_provider_update_params.AccessOidcConfig + | identity_provider_update_params.AccessOktaConfig + | identity_provider_update_params.AccessOneloginConfig + | identity_provider_update_params.AccessPingoneConfig + | identity_provider_update_params.AccessSamlConfig + | object, + name: str, + type: Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ], + account_id: str | NotGiven = NOT_GIVEN, + zone_id: str | NotGiven = NOT_GIVEN, + scim_config: identity_provider_update_params.AccessAzureAdScimConfig | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AccessIdentityProviders: if not uuid: raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") if not account_id: diff --git a/src/cloudflare/types/bot_management_update_params.py b/src/cloudflare/types/bot_management_update_params.py index c3092b91e5e..107db4627ef 100644 --- a/src/cloudflare/types/bot_management_update_params.py +++ b/src/cloudflare/types/bot_management_update_params.py @@ -2,22 +2,22 @@ from __future__ import annotations +from typing import Union from typing_extensions import Literal, Required, TypedDict -__all__ = ["BotManagementUpdateParams"] +__all__ = [ + "BotManagementUpdateParams", + "BotManagementBotFightModeConfig", + "BotManagementSbfmDefinitelyConfig", + "BotManagementSbfmLikelyConfig", + "BotManagementBmSubscriptionConfig", +] -class BotManagementUpdateParams(TypedDict, total=False): +class BotManagementBotFightModeConfig(TypedDict, total=False): zone_id: Required[str] """Identifier""" - auto_update_model: bool - """ - Automatically update to the newest bot detection models created by Cloudflare as - they are released. - [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) - """ - enable_js: bool """Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -27,6 +27,44 @@ class BotManagementUpdateParams(TypedDict, total=False): fight_mode: bool """Whether to enable Bot Fight Mode.""" + +class BotManagementSbfmDefinitelyConfig(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + enable_js: bool + """Use lightweight, invisible JavaScript detections to improve Bot Management. + + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + """ + + optimize_wordpress: bool + """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" + + sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] + """Super Bot Fight Mode (SBFM) action to take on definitely automated requests.""" + + sbfm_static_resource_protection: bool + """ + Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + static resources on your application need bot protection. Note: Static resource + protection can also result in legitimate traffic being blocked. + """ + + sbfm_verified_bots: Literal["allow", "block"] + """Super Bot Fight Mode (SBFM) action to take on verified bots requests.""" + + +class BotManagementSbfmLikelyConfig(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + enable_js: bool + """Use lightweight, invisible JavaScript detections to improve Bot Management. + + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + """ + optimize_wordpress: bool """Whether to optimize Super Bot Fight Mode protections for Wordpress.""" @@ -46,8 +84,34 @@ class BotManagementUpdateParams(TypedDict, total=False): sbfm_verified_bots: Literal["allow", "block"] """Super Bot Fight Mode (SBFM) action to take on verified bots requests.""" + +class BotManagementBmSubscriptionConfig(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + auto_update_model: bool + """ + Automatically update to the newest bot detection models created by Cloudflare as + they are released. + [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + """ + + enable_js: bool + """Use lightweight, invisible JavaScript detections to improve Bot Management. + + [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + """ + suppress_session_score: bool """ Whether to disable tracking the highest bot score for a session in the Bot Management cookie. """ + + +BotManagementUpdateParams = Union[ + BotManagementBotFightModeConfig, + BotManagementSbfmDefinitelyConfig, + BotManagementSbfmLikelyConfig, + BotManagementBmSubscriptionConfig, +] diff --git a/src/cloudflare/types/cache_purge_params.py b/src/cloudflare/types/cache_purge_params.py index a23cdaaf079..5eb2fbb56c7 100644 --- a/src/cloudflare/types/cache_purge_params.py +++ b/src/cloudflare/types/cache_purge_params.py @@ -5,27 +5,54 @@ from typing import List, Union from typing_extensions import Required, TypedDict -__all__ = ["CachePurgeParams", "File", "FileCachePurgeURLAndHeaders"] +__all__ = [ + "CachePurgeParams", + "CachePurgeTags", + "CachePurgeHosts", + "CachePurgePrefixes", + "CachePurgeEverything", + "CachePurgeFiles", + "CachePurgeFilesFile", + "CachePurgeFilesFileCachePurgeURLAndHeaders", +] + + +class CachePurgeTags(TypedDict, total=False): + zone_id: Required[str] + + tags: List[str] -class CachePurgeParams(TypedDict, total=False): +class CachePurgeHosts(TypedDict, total=False): zone_id: Required[str] - files: List[File] - hosts: List[str] + +class CachePurgePrefixes(TypedDict, total=False): + zone_id: Required[str] + prefixes: List[str] + +class CachePurgeEverything(TypedDict, total=False): + zone_id: Required[str] + purge_everything: bool - tags: List[str] +class CachePurgeFiles(TypedDict, total=False): + zone_id: Required[str] -class FileCachePurgeURLAndHeaders(TypedDict, total=False): + files: List[CachePurgeFilesFile] + + +class CachePurgeFilesFileCachePurgeURLAndHeaders(TypedDict, total=False): headers: object url: str -File = Union[str, FileCachePurgeURLAndHeaders] +CachePurgeFilesFile = Union[str, CachePurgeFilesFileCachePurgeURLAndHeaders] + +CachePurgeParams = Union[CachePurgeTags, CachePurgeHosts, CachePurgePrefixes, CachePurgeEverything, CachePurgeFiles] diff --git a/src/cloudflare/types/dns/record_create_params.py b/src/cloudflare/types/dns/record_create_params.py index bc7f916a7c9..ccb2d684b5c 100644 --- a/src/cloudflare/types/dns/record_create_params.py +++ b/src/cloudflare/types/dns/record_create_params.py @@ -5,40 +5,55 @@ from typing import List, Union from typing_extensions import Literal, Required, TypedDict -__all__ = ["RecordCreateParams", "Data", "Meta"] - - -class RecordCreateParams(TypedDict, total=False): +__all__ = [ + "RecordCreateParams", + "DNSRecordsARecord", + "DNSRecordsAAAARecord", + "DNSRecordsCAARecord", + "DNSRecordsCAARecordData", + "DNSRecordsCERTRecord", + "DNSRecordsCERTRecordData", + "DNSRecordsCNAMERecord", + "DNSRecordsDNSKEYRecord", + "DNSRecordsDNSKEYRecordData", + "DNSRecordsDSRecord", + "DNSRecordsDSRecordData", + "DNSRecordsHTTPSRecord", + "DNSRecordsHTTPSRecordData", + "DNSRecordsLOCRecord", + "DNSRecordsLOCRecordData", + "DNSRecordsMXRecord", + "DNSRecordsNAPTRRecord", + "DNSRecordsNAPTRRecordData", + "DNSRecordsNSRecord", + "DNSRecordsPTRRecord", + "DNSRecordsSMIMEARecord", + "DNSRecordsSMIMEARecordData", + "DNSRecordsSRVRecord", + "DNSRecordsSRVRecordData", + "DNSRecordsSSHFPRecord", + "DNSRecordsSSHFPRecordData", + "DNSRecordsSVCBRecord", + "DNSRecordsSVCBRecordData", + "DNSRecordsTLSARecord", + "DNSRecordsTLSARecordData", + "DNSRecordsTXTRecord", + "DNSRecordsURIRecord", + "DNSRecordsURIRecordData", +] + + +class DNSRecordsARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" + content: Required[str] + """A valid IPv4 address.""" + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - type: Required[ - Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ] - ] + type: Required[Literal["A"]] """Record type.""" comment: str @@ -47,17 +62,40 @@ class RecordCreateParams(TypedDict, total=False): This field has no effect on DNS responses. """ - content: object - """Formatted URI content. See 'data' to set URI properties.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - data: Data + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - meta: Meta + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - priority: float - """Required for MX, SRV and URI records; unused by other record types. + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - Records with lower priorities are preferred. + +class DNSRecordsAAAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid IPv6 address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ proxied: bool @@ -77,144 +115,806 @@ class RecordCreateParams(TypedDict, total=False): """ -class Data(TypedDict, total=False): - algorithm: float - """algorithm.""" +class DNSRecordsCAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - altitude: float - """Altitude of location in meters.""" + data: Required[DNSRecordsCAARecordData] + """Components of a CAA record.""" - certificate: str - """certificate.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - content: str - """The record content.""" + type: Required[Literal["CAA"]] + """Record type.""" - digest: str - """Digest.""" + comment: str + """Comments or notes about the DNS record. - digest_type: float - """Digest Type.""" + This field has no effect on DNS responses. + """ - fingerprint: str - """fingerprint.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - flags: object - """Flags.""" + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" + + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + + value: str + """Value of the record. This field's semantics depend on the chosen tag.""" + + +class DNSRecordsCERTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsCERTRecordData] + """Components of a CERT record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + certificate: str + """Certificate.""" key_tag: float """Key Tag.""" - lat_degrees: float - """Degrees of latitude.""" + type: float + """Type.""" - lat_direction: Literal["N", "S"] - """Latitude direction.""" - lat_minutes: float - """Minutes of latitude.""" +class DNSRecordsCNAMERecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - lat_seconds: float - """Seconds of latitude.""" + content: Required[object] + """A valid hostname. Must not match the record's name.""" - long_degrees: float - """Degrees of longitude.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - long_direction: Literal["E", "W"] - """Longitude direction.""" + type: Required[Literal["CNAME"]] + """Record type.""" - long_minutes: float - """Minutes of longitude.""" + comment: str + """Comments or notes about the DNS record. - long_seconds: float - """Seconds of longitude.""" + This field has no effect on DNS responses. + """ - matching_type: float - """Matching Type.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - name: str - """A valid hostname. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field represents the remainder of the full 'name' after the service and - protocol. + ttl: Union[float, Literal[1]] + """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. """ - order: float - """Order.""" - port: float - """The port of the service.""" +class DNSRecordsDNSKEYRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - precision_horz: float - """Horizontal precision of location.""" + data: Required[DNSRecordsDNSKEYRecordData] + """Components of a DNSKEY record.""" - precision_vert: float - """Vertical precision of location.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - preference: float - """Preference.""" + type: Required[Literal["DNSKEY"]] + """Record type.""" - priority: float - """priority.""" + comment: str + """Comments or notes about the DNS record. - proto: str - """A valid protocol, prefixed with an underscore. + This field has no effect on DNS responses. + """ - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the second label of that 'name'. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ + +class DNSRecordsDNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + flags: float + """Flags.""" + protocol: float """Protocol.""" public_key: str """Public Key.""" - regex: str - """Regex.""" - replacement: str - """Replacement.""" +class DNSRecordsDSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - selector: float - """Selector.""" + data: Required[DNSRecordsDSRecordData] + """Components of a DS record.""" - service: str - """A service type, prefixed with an underscore. + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the first label of that 'name'. + type: Required[Literal["DS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ - size: float - """Size of location in meters.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - target: str - """target.""" + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - type: float - """type.""" - usage: float - """Usage.""" +class DNSRecordsDSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - value: str - """value.""" + digest: str + """Digest.""" - weight: float - """The record weight.""" + digest_type: float + """Digest Type.""" + + key_tag: float + """Key Tag.""" + + +class DNSRecordsHTTPSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsHTTPSRecordData] + """Components of a HTTPS record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str + """Comments or notes about the DNS record. -class Meta(TypedDict, total=False): - auto_added: bool + This field has no effect on DNS responses. """ - Will exist if Cloudflare automatically added this DNS record during initial - setup. + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ - source: str - """Where the record originated from.""" + +class DNSRecordsHTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsLOCRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsLOCRecordData] + """Components of a LOC record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsLOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" + + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class DNSRecordsMXRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid mail server hostname.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["MX"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsNAPTRRecordData] + """Components of a NAPTR record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" + + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class DNSRecordsNSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[object] + """A valid name server host name.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Domain name pointing to the address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSMIMEARecordData] + """Components of a SMIMEA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecordData(TypedDict, total=False): + certificate: str + """Certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsSRVRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSRVRecordData] + """Components of a SRV record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode. + + For SRV records, the first label is normally a service and the second a protocol + name, each starting with an underscore. + """ + + type: Required[Literal["SRV"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSRVRecordData(TypedDict, total=False): + name: str + """A valid hostname. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field represents the remainder of the full 'name' after the service and + protocol. + """ + + port: float + """The port of the service.""" + + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + proto: str + """A valid protocol, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the second label of that 'name'. + """ + + service: str + """A service type, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the first label of that 'name'. + """ + + target: str + """A valid hostname.""" + + weight: float + """The record weight.""" + + +class DNSRecordsSSHFPRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSSHFPRecordData] + """Components of a SSHFP record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSSHFPRecordData(TypedDict, total=False): + algorithm: float + """algorithm.""" + + fingerprint: str + """fingerprint.""" + + type: float + """type.""" + + +class DNSRecordsSVCBRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSVCBRecordData] + """Components of a SVCB record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSVCBRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsTLSARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsTLSARecordData] + """Components of a TLSA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsTLSARecordData(TypedDict, total=False): + certificate: str + """certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsTXTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Text content for the record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsURIRecordData] + """Components of a URI record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["URI"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecordData(TypedDict, total=False): + content: str + """The record content.""" + + weight: float + """The record weight.""" + + +RecordCreateParams = Union[ + DNSRecordsARecord, + DNSRecordsAAAARecord, + DNSRecordsCAARecord, + DNSRecordsCERTRecord, + DNSRecordsCNAMERecord, + DNSRecordsDNSKEYRecord, + DNSRecordsDSRecord, + DNSRecordsHTTPSRecord, + DNSRecordsLOCRecord, + DNSRecordsMXRecord, + DNSRecordsNAPTRRecord, + DNSRecordsNSRecord, + DNSRecordsPTRRecord, + DNSRecordsSMIMEARecord, + DNSRecordsSRVRecord, + DNSRecordsSSHFPRecord, + DNSRecordsSVCBRecord, + DNSRecordsTLSARecord, + DNSRecordsTXTRecord, + DNSRecordsURIRecord, +] diff --git a/src/cloudflare/types/dns/record_edit_params.py b/src/cloudflare/types/dns/record_edit_params.py index 3dd185c6caf..be1da501da9 100644 --- a/src/cloudflare/types/dns/record_edit_params.py +++ b/src/cloudflare/types/dns/record_edit_params.py @@ -5,40 +5,55 @@ from typing import List, Union from typing_extensions import Literal, Required, TypedDict -__all__ = ["RecordEditParams", "Data", "Meta"] - - -class RecordEditParams(TypedDict, total=False): +__all__ = [ + "RecordEditParams", + "DNSRecordsARecord", + "DNSRecordsAAAARecord", + "DNSRecordsCAARecord", + "DNSRecordsCAARecordData", + "DNSRecordsCERTRecord", + "DNSRecordsCERTRecordData", + "DNSRecordsCNAMERecord", + "DNSRecordsDNSKEYRecord", + "DNSRecordsDNSKEYRecordData", + "DNSRecordsDSRecord", + "DNSRecordsDSRecordData", + "DNSRecordsHTTPSRecord", + "DNSRecordsHTTPSRecordData", + "DNSRecordsLOCRecord", + "DNSRecordsLOCRecordData", + "DNSRecordsMXRecord", + "DNSRecordsNAPTRRecord", + "DNSRecordsNAPTRRecordData", + "DNSRecordsNSRecord", + "DNSRecordsPTRRecord", + "DNSRecordsSMIMEARecord", + "DNSRecordsSMIMEARecordData", + "DNSRecordsSRVRecord", + "DNSRecordsSRVRecordData", + "DNSRecordsSSHFPRecord", + "DNSRecordsSSHFPRecordData", + "DNSRecordsSVCBRecord", + "DNSRecordsSVCBRecordData", + "DNSRecordsTLSARecord", + "DNSRecordsTLSARecordData", + "DNSRecordsTXTRecord", + "DNSRecordsURIRecord", + "DNSRecordsURIRecordData", +] + + +class DNSRecordsARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" + content: Required[str] + """A valid IPv4 address.""" + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - type: Required[ - Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ] - ] + type: Required[Literal["A"]] """Record type.""" comment: str @@ -47,17 +62,40 @@ class RecordEditParams(TypedDict, total=False): This field has no effect on DNS responses. """ - content: object - """Formatted URI content. See 'data' to set URI properties.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - data: Data + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - meta: Meta + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - priority: float - """Required for MX, SRV and URI records; unused by other record types. + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - Records with lower priorities are preferred. + +class DNSRecordsAAAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid IPv6 address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ proxied: bool @@ -77,144 +115,806 @@ class RecordEditParams(TypedDict, total=False): """ -class Data(TypedDict, total=False): - algorithm: float - """algorithm.""" +class DNSRecordsCAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - altitude: float - """Altitude of location in meters.""" + data: Required[DNSRecordsCAARecordData] + """Components of a CAA record.""" - certificate: str - """certificate.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - content: str - """The record content.""" + type: Required[Literal["CAA"]] + """Record type.""" - digest: str - """Digest.""" + comment: str + """Comments or notes about the DNS record. - digest_type: float - """Digest Type.""" + This field has no effect on DNS responses. + """ - fingerprint: str - """fingerprint.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - flags: object - """Flags.""" + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" + + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + + value: str + """Value of the record. This field's semantics depend on the chosen tag.""" + + +class DNSRecordsCERTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsCERTRecordData] + """Components of a CERT record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + certificate: str + """Certificate.""" key_tag: float """Key Tag.""" - lat_degrees: float - """Degrees of latitude.""" + type: float + """Type.""" - lat_direction: Literal["N", "S"] - """Latitude direction.""" - lat_minutes: float - """Minutes of latitude.""" +class DNSRecordsCNAMERecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - lat_seconds: float - """Seconds of latitude.""" + content: Required[object] + """A valid hostname. Must not match the record's name.""" - long_degrees: float - """Degrees of longitude.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - long_direction: Literal["E", "W"] - """Longitude direction.""" + type: Required[Literal["CNAME"]] + """Record type.""" - long_minutes: float - """Minutes of longitude.""" + comment: str + """Comments or notes about the DNS record. - long_seconds: float - """Seconds of longitude.""" + This field has no effect on DNS responses. + """ - matching_type: float - """Matching Type.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - name: str - """A valid hostname. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field represents the remainder of the full 'name' after the service and - protocol. + ttl: Union[float, Literal[1]] + """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. """ - order: float - """Order.""" - port: float - """The port of the service.""" +class DNSRecordsDNSKEYRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - precision_horz: float - """Horizontal precision of location.""" + data: Required[DNSRecordsDNSKEYRecordData] + """Components of a DNSKEY record.""" - precision_vert: float - """Vertical precision of location.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - preference: float - """Preference.""" + type: Required[Literal["DNSKEY"]] + """Record type.""" - priority: float - """priority.""" + comment: str + """Comments or notes about the DNS record. - proto: str - """A valid protocol, prefixed with an underscore. + This field has no effect on DNS responses. + """ - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the second label of that 'name'. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ + +class DNSRecordsDNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + flags: float + """Flags.""" + protocol: float """Protocol.""" public_key: str """Public Key.""" - regex: str - """Regex.""" - replacement: str - """Replacement.""" +class DNSRecordsDSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - selector: float - """Selector.""" + data: Required[DNSRecordsDSRecordData] + """Components of a DS record.""" - service: str - """A service type, prefixed with an underscore. + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the first label of that 'name'. + type: Required[Literal["DS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ - size: float - """Size of location in meters.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - target: str - """target.""" + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - type: float - """type.""" - usage: float - """Usage.""" +class DNSRecordsDSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - value: str - """value.""" + digest: str + """Digest.""" - weight: float - """The record weight.""" + digest_type: float + """Digest Type.""" + + key_tag: float + """Key Tag.""" + + +class DNSRecordsHTTPSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsHTTPSRecordData] + """Components of a HTTPS record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str + """Comments or notes about the DNS record. -class Meta(TypedDict, total=False): - auto_added: bool + This field has no effect on DNS responses. """ - Will exist if Cloudflare automatically added this DNS record during initial - setup. + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ - source: str - """Where the record originated from.""" + +class DNSRecordsHTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsLOCRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsLOCRecordData] + """Components of a LOC record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsLOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" + + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class DNSRecordsMXRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid mail server hostname.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["MX"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsNAPTRRecordData] + """Components of a NAPTR record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" + + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class DNSRecordsNSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[object] + """A valid name server host name.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Domain name pointing to the address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSMIMEARecordData] + """Components of a SMIMEA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecordData(TypedDict, total=False): + certificate: str + """Certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsSRVRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSRVRecordData] + """Components of a SRV record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode. + + For SRV records, the first label is normally a service and the second a protocol + name, each starting with an underscore. + """ + + type: Required[Literal["SRV"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSRVRecordData(TypedDict, total=False): + name: str + """A valid hostname. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field represents the remainder of the full 'name' after the service and + protocol. + """ + + port: float + """The port of the service.""" + + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + proto: str + """A valid protocol, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the second label of that 'name'. + """ + + service: str + """A service type, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the first label of that 'name'. + """ + + target: str + """A valid hostname.""" + + weight: float + """The record weight.""" + + +class DNSRecordsSSHFPRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSSHFPRecordData] + """Components of a SSHFP record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSSHFPRecordData(TypedDict, total=False): + algorithm: float + """algorithm.""" + + fingerprint: str + """fingerprint.""" + + type: float + """type.""" + + +class DNSRecordsSVCBRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSVCBRecordData] + """Components of a SVCB record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSVCBRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsTLSARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsTLSARecordData] + """Components of a TLSA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsTLSARecordData(TypedDict, total=False): + certificate: str + """certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsTXTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Text content for the record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsURIRecordData] + """Components of a URI record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["URI"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecordData(TypedDict, total=False): + content: str + """The record content.""" + + weight: float + """The record weight.""" + + +RecordEditParams = Union[ + DNSRecordsARecord, + DNSRecordsAAAARecord, + DNSRecordsCAARecord, + DNSRecordsCERTRecord, + DNSRecordsCNAMERecord, + DNSRecordsDNSKEYRecord, + DNSRecordsDSRecord, + DNSRecordsHTTPSRecord, + DNSRecordsLOCRecord, + DNSRecordsMXRecord, + DNSRecordsNAPTRRecord, + DNSRecordsNSRecord, + DNSRecordsPTRRecord, + DNSRecordsSMIMEARecord, + DNSRecordsSRVRecord, + DNSRecordsSSHFPRecord, + DNSRecordsSVCBRecord, + DNSRecordsTLSARecord, + DNSRecordsTXTRecord, + DNSRecordsURIRecord, +] diff --git a/src/cloudflare/types/dns/record_update_params.py b/src/cloudflare/types/dns/record_update_params.py index 7759dab7b28..7bbbd9d2854 100644 --- a/src/cloudflare/types/dns/record_update_params.py +++ b/src/cloudflare/types/dns/record_update_params.py @@ -5,40 +5,55 @@ from typing import List, Union from typing_extensions import Literal, Required, TypedDict -__all__ = ["RecordUpdateParams", "Data", "Meta"] - - -class RecordUpdateParams(TypedDict, total=False): +__all__ = [ + "RecordUpdateParams", + "DNSRecordsARecord", + "DNSRecordsAAAARecord", + "DNSRecordsCAARecord", + "DNSRecordsCAARecordData", + "DNSRecordsCERTRecord", + "DNSRecordsCERTRecordData", + "DNSRecordsCNAMERecord", + "DNSRecordsDNSKEYRecord", + "DNSRecordsDNSKEYRecordData", + "DNSRecordsDSRecord", + "DNSRecordsDSRecordData", + "DNSRecordsHTTPSRecord", + "DNSRecordsHTTPSRecordData", + "DNSRecordsLOCRecord", + "DNSRecordsLOCRecordData", + "DNSRecordsMXRecord", + "DNSRecordsNAPTRRecord", + "DNSRecordsNAPTRRecordData", + "DNSRecordsNSRecord", + "DNSRecordsPTRRecord", + "DNSRecordsSMIMEARecord", + "DNSRecordsSMIMEARecordData", + "DNSRecordsSRVRecord", + "DNSRecordsSRVRecordData", + "DNSRecordsSSHFPRecord", + "DNSRecordsSSHFPRecordData", + "DNSRecordsSVCBRecord", + "DNSRecordsSVCBRecordData", + "DNSRecordsTLSARecord", + "DNSRecordsTLSARecordData", + "DNSRecordsTXTRecord", + "DNSRecordsURIRecord", + "DNSRecordsURIRecordData", +] + + +class DNSRecordsARecord(TypedDict, total=False): zone_id: Required[str] """Identifier""" + content: Required[str] + """A valid IPv4 address.""" + name: Required[str] """DNS record name (or @ for the zone apex) in Punycode.""" - type: Required[ - Literal[ - "URI", - "TXT", - "TLSA", - "SVCB", - "SSHFP", - "SRV", - "SMIMEA", - "PTR", - "NS", - "NAPTR", - "MX", - "LOC", - "HTTPS", - "DS", - "DNSKEY", - "CNAME", - "CERT", - "CAA", - "AAAA", - "A", - ] - ] + type: Required[Literal["A"]] """Record type.""" comment: str @@ -47,17 +62,40 @@ class RecordUpdateParams(TypedDict, total=False): This field has no effect on DNS responses. """ - content: object - """Formatted URI content. See 'data' to set URI properties.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - data: Data + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - meta: Meta + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - priority: float - """Required for MX, SRV and URI records; unused by other record types. + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - Records with lower priorities are preferred. + +class DNSRecordsAAAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid IPv6 address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["AAAA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ proxied: bool @@ -77,144 +115,806 @@ class RecordUpdateParams(TypedDict, total=False): """ -class Data(TypedDict, total=False): - algorithm: float - """algorithm.""" +class DNSRecordsCAARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - altitude: float - """Altitude of location in meters.""" + data: Required[DNSRecordsCAARecordData] + """Components of a CAA record.""" - certificate: str - """certificate.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - content: str - """The record content.""" + type: Required[Literal["CAA"]] + """Record type.""" - digest: str - """Digest.""" + comment: str + """Comments or notes about the DNS record. - digest_type: float - """Digest Type.""" + This field has no effect on DNS responses. + """ - fingerprint: str - """fingerprint.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - flags: object - """Flags.""" + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCAARecordData(TypedDict, total=False): + flags: float + """Flags for the CAA record.""" + + tag: str + """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + + value: str + """Value of the record. This field's semantics depend on the chosen tag.""" + + +class DNSRecordsCERTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsCERTRecordData] + """Components of a CERT record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["CERT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsCERTRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + certificate: str + """Certificate.""" key_tag: float """Key Tag.""" - lat_degrees: float - """Degrees of latitude.""" + type: float + """Type.""" - lat_direction: Literal["N", "S"] - """Latitude direction.""" - lat_minutes: float - """Minutes of latitude.""" +class DNSRecordsCNAMERecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - lat_seconds: float - """Seconds of latitude.""" + content: Required[object] + """A valid hostname. Must not match the record's name.""" - long_degrees: float - """Degrees of longitude.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - long_direction: Literal["E", "W"] - """Longitude direction.""" + type: Required[Literal["CNAME"]] + """Record type.""" - long_minutes: float - """Minutes of longitude.""" + comment: str + """Comments or notes about the DNS record. - long_seconds: float - """Seconds of longitude.""" + This field has no effect on DNS responses. + """ - matching_type: float - """Matching Type.""" + proxied: bool + """ + Whether the record is receiving the performance and security benefits of + Cloudflare. + """ - name: str - """A valid hostname. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field represents the remainder of the full 'name' after the service and - protocol. + ttl: Union[float, Literal[1]] + """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. """ - order: float - """Order.""" - port: float - """The port of the service.""" +class DNSRecordsDNSKEYRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - precision_horz: float - """Horizontal precision of location.""" + data: Required[DNSRecordsDNSKEYRecordData] + """Components of a DNSKEY record.""" - precision_vert: float - """Vertical precision of location.""" + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - preference: float - """Preference.""" + type: Required[Literal["DNSKEY"]] + """Record type.""" - priority: float - """priority.""" + comment: str + """Comments or notes about the DNS record. - proto: str - """A valid protocol, prefixed with an underscore. + This field has no effect on DNS responses. + """ - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the second label of that 'name'. + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ + +class DNSRecordsDNSKEYRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" + + flags: float + """Flags.""" + protocol: float """Protocol.""" public_key: str """Public Key.""" - regex: str - """Regex.""" - replacement: str - """Replacement.""" +class DNSRecordsDSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" - selector: float - """Selector.""" + data: Required[DNSRecordsDSRecordData] + """Components of a DS record.""" - service: str - """A service type, prefixed with an underscore. + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" - Deprecated in favor of the regular 'name' outside the data map. This data map - field normally represents the first label of that 'name'. + type: Required[Literal["DS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. """ - size: float - """Size of location in meters.""" + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" - tag: str - """Name of the property controlled by this record (e.g.: issue, issuewild, iodef).""" + ttl: Union[float, Literal[1]] + """Time To Live (TTL) of the DNS record in seconds. - target: str - """target.""" + Setting to 1 means 'automatic'. Value must be between 60 and 86400, with the + minimum reduced to 30 for Enterprise zones. + """ - type: float - """type.""" - usage: float - """Usage.""" +class DNSRecordsDSRecordData(TypedDict, total=False): + algorithm: float + """Algorithm.""" - value: str - """value.""" + digest: str + """Digest.""" - weight: float - """The record weight.""" + digest_type: float + """Digest Type.""" + + key_tag: float + """Key Tag.""" + + +class DNSRecordsHTTPSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsHTTPSRecordData] + """Components of a HTTPS record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["HTTPS"]] + """Record type.""" + comment: str + """Comments or notes about the DNS record. -class Meta(TypedDict, total=False): - auto_added: bool + This field has no effect on DNS responses. """ - Will exist if Cloudflare automatically added this DNS record during initial - setup. + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. """ - source: str - """Where the record originated from.""" + +class DNSRecordsHTTPSRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsLOCRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsLOCRecordData] + """Components of a LOC record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["LOC"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsLOCRecordData(TypedDict, total=False): + altitude: float + """Altitude of location in meters.""" + + lat_degrees: float + """Degrees of latitude.""" + + lat_direction: Literal["N", "S"] + """Latitude direction.""" + + lat_minutes: float + """Minutes of latitude.""" + + lat_seconds: float + """Seconds of latitude.""" + + long_degrees: float + """Degrees of longitude.""" + + long_direction: Literal["E", "W"] + """Longitude direction.""" + + long_minutes: float + """Minutes of longitude.""" + + long_seconds: float + """Seconds of longitude.""" + + precision_horz: float + """Horizontal precision of location.""" + + precision_vert: float + """Vertical precision of location.""" + + size: float + """Size of location in meters.""" + + +class DNSRecordsMXRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """A valid mail server hostname.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["MX"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsNAPTRRecordData] + """Components of a NAPTR record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NAPTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsNAPTRRecordData(TypedDict, total=False): + flags: str + """Flags.""" + + order: float + """Order.""" + + preference: float + """Preference.""" + + regex: str + """Regex.""" + + replacement: str + """Replacement.""" + + service: str + """Service.""" + + +class DNSRecordsNSRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[object] + """A valid name server host name.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["NS"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsPTRRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Domain name pointing to the address.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["PTR"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSMIMEARecordData] + """Components of a SMIMEA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SMIMEA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSMIMEARecordData(TypedDict, total=False): + certificate: str + """Certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsSRVRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSRVRecordData] + """Components of a SRV record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode. + + For SRV records, the first label is normally a service and the second a protocol + name, each starting with an underscore. + """ + + type: Required[Literal["SRV"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSRVRecordData(TypedDict, total=False): + name: str + """A valid hostname. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field represents the remainder of the full 'name' after the service and + protocol. + """ + + port: float + """The port of the service.""" + + priority: float + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + proto: str + """A valid protocol, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the second label of that 'name'. + """ + + service: str + """A service type, prefixed with an underscore. + + Deprecated in favor of the regular 'name' outside the data map. This data map + field normally represents the first label of that 'name'. + """ + + target: str + """A valid hostname.""" + + weight: float + """The record weight.""" + + +class DNSRecordsSSHFPRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSSHFPRecordData] + """Components of a SSHFP record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SSHFP"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSSHFPRecordData(TypedDict, total=False): + algorithm: float + """algorithm.""" + + fingerprint: str + """fingerprint.""" + + type: float + """type.""" + + +class DNSRecordsSVCBRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsSVCBRecordData] + """Components of a SVCB record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["SVCB"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsSVCBRecordData(TypedDict, total=False): + priority: float + """priority.""" + + target: str + """target.""" + + value: str + """value.""" + + +class DNSRecordsTLSARecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsTLSARecordData] + """Components of a TLSA record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TLSA"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsTLSARecordData(TypedDict, total=False): + certificate: str + """certificate.""" + + matching_type: float + """Matching Type.""" + + selector: float + """Selector.""" + + usage: float + """Usage.""" + + +class DNSRecordsTXTRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + content: Required[str] + """Text content for the record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + type: Required[Literal["TXT"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecord(TypedDict, total=False): + zone_id: Required[str] + """Identifier""" + + data: Required[DNSRecordsURIRecordData] + """Components of a URI record.""" + + name: Required[str] + """DNS record name (or @ for the zone apex) in Punycode.""" + + priority: Required[float] + """Required for MX, SRV and URI records; unused by other record types. + + Records with lower priorities are preferred. + """ + + type: Required[Literal["URI"]] + """Record type.""" + + comment: str + """Comments or notes about the DNS record. + + This field has no effect on DNS responses. + """ + + tags: List[str] + """Custom tags for the DNS record. This field has no effect on DNS responses.""" + + ttl: Union[float, Literal[1]] + """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. + """ + + +class DNSRecordsURIRecordData(TypedDict, total=False): + content: str + """The record content.""" + + weight: float + """The record weight.""" + + +RecordUpdateParams = Union[ + DNSRecordsARecord, + DNSRecordsAAAARecord, + DNSRecordsCAARecord, + DNSRecordsCERTRecord, + DNSRecordsCNAMERecord, + DNSRecordsDNSKEYRecord, + DNSRecordsDSRecord, + DNSRecordsHTTPSRecord, + DNSRecordsLOCRecord, + DNSRecordsMXRecord, + DNSRecordsNAPTRRecord, + DNSRecordsNSRecord, + DNSRecordsPTRRecord, + DNSRecordsSMIMEARecord, + DNSRecordsSRVRecord, + DNSRecordsSSHFPRecord, + DNSRecordsSVCBRecord, + DNSRecordsTLSARecord, + DNSRecordsTXTRecord, + DNSRecordsURIRecord, +] diff --git a/src/cloudflare/types/images/v1_create_params.py b/src/cloudflare/types/images/v1_create_params.py index 8f833ca85fb..a093cf419e5 100644 --- a/src/cloudflare/types/images/v1_create_params.py +++ b/src/cloudflare/types/images/v1_create_params.py @@ -2,18 +2,26 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import Union +from typing_extensions import Required, TypedDict -from ..._utils import PropertyInfo +__all__ = ["V1CreateParams", "ImagesImageUploadViaFile", "ImagesImageUploadViaURL"] -__all__ = ["V1CreateParams"] +class ImagesImageUploadViaFile(TypedDict, total=False): + account_id: Required[str] + """Account identifier tag.""" + + file: Required[object] + """An image binary data.""" -class V1CreateParams(TypedDict, total=False): + +class ImagesImageUploadViaURL(TypedDict, total=False): account_id: Required[str] """Account identifier tag.""" - metadata: object + url: Required[str] + """A URL to fetch an image from origin.""" + - require_signed_urls: Annotated[bool, PropertyInfo(alias="requireSignedURLs")] - """Indicates whether the image requires a signature token for the access.""" +V1CreateParams = Union[ImagesImageUploadViaFile, ImagesImageUploadViaURL] diff --git a/src/cloudflare/types/pcap_create_params.py b/src/cloudflare/types/pcap_create_params.py index 6591d471a1c..cedbeb11578 100644 --- a/src/cloudflare/types/pcap_create_params.py +++ b/src/cloudflare/types/pcap_create_params.py @@ -2,15 +2,25 @@ from __future__ import annotations +from typing import Union from typing_extensions import Literal, Required, TypedDict -__all__ = ["PCAPCreateParams", "FilterV1"] +__all__ = [ + "PCAPCreateParams", + "MagicVisibilityPCAPsRequestSimple", + "MagicVisibilityPCAPsRequestSimpleFilterV1", + "MagicVisibilityPCAPsRequestFull", + "MagicVisibilityPCAPsRequestFullFilterV1", +] -class PCAPCreateParams(TypedDict, total=False): +class MagicVisibilityPCAPsRequestSimple(TypedDict, total=False): account_id: Required[str] """Identifier""" + packet_limit: Required[float] + """The limit of packets contained in a packet capture.""" + system: Required[Literal["magic-transit"]] """The system used to collect packet captures.""" @@ -24,29 +34,68 @@ class PCAPCreateParams(TypedDict, total=False): non-sampled packets. """ - byte_limit: float - """The maximum number of bytes to capture. + filter_v1: MagicVisibilityPCAPsRequestSimpleFilterV1 + """The packet capture filter. When this field is empty, all packets are captured.""" - This field only applies to `full` packet captures. - """ - colo_name: str +class MagicVisibilityPCAPsRequestSimpleFilterV1(TypedDict, total=False): + destination_address: str + """The destination IP address of the packet.""" + + destination_port: float + """The destination port of the packet.""" + + protocol: float + """The protocol number of the packet.""" + + source_address: str + """The source IP address of the packet.""" + + source_port: float + """The source port of the packet.""" + + +class MagicVisibilityPCAPsRequestFull(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + colo_name: Required[str] """The name of the data center used for the packet capture. This can be a specific colo (ord02) or a multi-colo name (ORD). This field only applies to `full` packet captures. """ - destination_conf: str + destination_conf: Required[str] """The full URI for the bucket. This field only applies to `full` packet captures.""" - filter_v1: FilterV1 + system: Required[Literal["magic-transit"]] + """The system used to collect packet captures.""" + + time_limit: Required[float] + """The packet capture duration in seconds.""" + + type: Required[Literal["simple", "full"]] + """The type of packet capture. + + `Simple` captures sampled packets, and `full` captures entire payloads and + non-sampled packets. + """ + + byte_limit: float + """The maximum number of bytes to capture. + + This field only applies to `full` packet captures. + """ + + filter_v1: MagicVisibilityPCAPsRequestFullFilterV1 + """The packet capture filter. When this field is empty, all packets are captured.""" packet_limit: float """The limit of packets contained in a packet capture.""" -class FilterV1(TypedDict, total=False): +class MagicVisibilityPCAPsRequestFullFilterV1(TypedDict, total=False): destination_address: str """The destination IP address of the packet.""" @@ -61,3 +110,6 @@ class FilterV1(TypedDict, total=False): source_port: float """The source port of the packet.""" + + +PCAPCreateParams = Union[MagicVisibilityPCAPsRequestSimple, MagicVisibilityPCAPsRequestFull] diff --git a/src/cloudflare/types/r2/sippy_update_params.py b/src/cloudflare/types/r2/sippy_update_params.py index 66e34187ca8..7730cbef116 100644 --- a/src/cloudflare/types/r2/sippy_update_params.py +++ b/src/cloudflare/types/r2/sippy_update_params.py @@ -2,23 +2,34 @@ from __future__ import annotations +from typing import Union from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo -__all__ = ["SippyUpdateParams", "Destination", "Source"] +__all__ = [ + "SippyUpdateParams", + "R2EnableSippyAws", + "R2EnableSippyAwsDestination", + "R2EnableSippyAwsSource", + "R2EnableSippyGcs", + "R2EnableSippyGcsDestination", + "R2EnableSippyGcsSource", +] -class SippyUpdateParams(TypedDict, total=False): +class R2EnableSippyAws(TypedDict, total=False): account_id: Required[str] """Account ID""" - destination: Destination + destination: R2EnableSippyAwsDestination + """R2 bucket to copy objects to""" - source: Source + source: R2EnableSippyAwsSource + """AWS S3 bucket to copy objects from""" -class Destination(TypedDict, total=False): +class R2EnableSippyAwsDestination(TypedDict, total=False): access_key_id: Annotated[str, PropertyInfo(alias="accessKeyId")] """ ID of a Cloudflare API token. This is the value labelled "Access Key ID" when @@ -42,10 +53,58 @@ class Destination(TypedDict, total=False): """ -class Source(TypedDict, total=False): +class R2EnableSippyAwsSource(TypedDict, total=False): access_key_id: Annotated[str, PropertyInfo(alias="accessKeyId")] """Access Key ID of an IAM credential (ideally scoped to a single S3 bucket)""" + bucket: str + """Name of the AWS S3 bucket""" + + provider: Literal["aws"] + + region: str + """Name of the AWS availability zone""" + + secret_access_key: Annotated[str, PropertyInfo(alias="secretAccessKey")] + """Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket)""" + + +class R2EnableSippyGcs(TypedDict, total=False): + account_id: Required[str] + """Account ID""" + + destination: R2EnableSippyGcsDestination + """R2 bucket to copy objects to""" + + source: R2EnableSippyGcsSource + """GCS bucket to copy objects from""" + + +class R2EnableSippyGcsDestination(TypedDict, total=False): + access_key_id: Annotated[str, PropertyInfo(alias="accessKeyId")] + """ + ID of a Cloudflare API token. This is the value labelled "Access Key ID" when + creating an API token from the + [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens). + + Sippy will use this token when writing objects to R2, so it is best to scope + this token to the bucket you're enabling Sippy for. + """ + + provider: Literal["r2"] + + secret_access_key: Annotated[str, PropertyInfo(alias="secretAccessKey")] + """ + Value of a Cloudflare API token. This is the value labelled "Secret Access Key" + when creating an API token from the + [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens). + + Sippy will use this token when writing objects to R2, so it is best to scope + this token to the bucket you're enabling Sippy for. + """ + + +class R2EnableSippyGcsSource(TypedDict, total=False): bucket: str """Name of the GCS bucket""" @@ -55,10 +114,7 @@ class Source(TypedDict, total=False): private_key: Annotated[str, PropertyInfo(alias="privateKey")] """Private Key of an IAM credential (ideally scoped to a single GCS bucket)""" - provider: Literal["gcs", "aws"] + provider: Literal["gcs"] - region: str - """Name of the AWS availability zone""" - secret_access_key: Annotated[str, PropertyInfo(alias="secretAccessKey")] - """Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket)""" +SippyUpdateParams = Union[R2EnableSippyAws, R2EnableSippyGcs] diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index 1427e7774e3..3a8867ac974 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -2,42 +2,324 @@ from __future__ import annotations -from typing import Union -from typing_extensions import TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, TypedDict -__all__ = ["RuleCreateParams", "Position", "PositionBeforePosition", "PositionAfterPosition", "PositionIndexPosition"] +__all__ = [ + "RuleCreateParams", + "RulesetsBlockRule", + "RulesetsBlockRuleActionParameters", + "RulesetsBlockRuleActionParametersResponse", + "RulesetsBlockRuleLogging", + "RulesetsExecuteRule", + "RulesetsExecuteRuleActionParameters", + "RulesetsExecuteRuleActionParametersMatchedData", + "RulesetsExecuteRuleActionParametersOverrides", + "RulesetsExecuteRuleActionParametersOverridesCategory", + "RulesetsExecuteRuleActionParametersOverridesRule", + "RulesetsExecuteRuleLogging", + "RulesetsLogRule", + "RulesetsLogRuleLogging", + "RulesetsSkipRule", + "RulesetsSkipRuleActionParameters", + "RulesetsSkipRuleLogging", +] -class RuleCreateParams(TypedDict, total=False): +class RulesetsBlockRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - position: Position - """An object configuring where the rule will be placed.""" + id: str + """The unique ID of the rule.""" + action: Literal["block"] + """The action to perform when the rule matches.""" -class PositionBeforePosition(TypedDict, total=False): - before: str - """The ID of another rule to place the rule before. + action_parameters: RulesetsBlockRuleActionParameters + """The parameters configuring the rule's action.""" - An empty value causes the rule to be placed at the top. + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsBlockRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsBlockRuleActionParametersResponse(TypedDict, total=False): + content: Required[str] + """The content to return.""" + + content_type: Required[str] + """The type of the content to return.""" + + status_code: Required[int] + """The status code to return.""" + + +class RulesetsBlockRuleActionParameters(TypedDict, total=False): + response: RulesetsBlockRuleActionParametersResponse + """The response to show when the block is applied.""" + + +class RulesetsBlockRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsExecuteRule(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["execute"] + """The action to perform when the rule matches.""" + + action_parameters: RulesetsExecuteRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsExecuteRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsExecuteRuleActionParametersMatchedData(TypedDict, total=False): + public_key: Required[str] + """The public key to encrypt matched data logs with.""" + + +class RulesetsExecuteRuleActionParametersOverridesCategory(TypedDict, total=False): + category: Required[str] + """The name of the category to override.""" + + action: str + """The action to override rules in the category with.""" + + enabled: bool + """Whether to enable execution of rules in the category.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """The sensitivity level to use for rules in the category.""" + + +class RulesetsExecuteRuleActionParametersOverridesRule(TypedDict, total=False): + id: Required[str] + """The ID of the rule to override.""" + + action: str + """The action to override the rule with.""" + + enabled: bool + """Whether to enable execution of the rule.""" + + score_threshold: int + """The score threshold to use for the rule.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """The sensitivity level to use for the rule.""" + + +class RulesetsExecuteRuleActionParametersOverrides(TypedDict, total=False): + action: str + """An action to override all rules with. + + This option has lower precedence than rule and category overrides. + """ + + categories: Iterable[RulesetsExecuteRuleActionParametersOverridesCategory] + """A list of category-level overrides. + + This option has the second-highest precedence after rule-level overrides. + """ + + enabled: bool + """Whether to enable execution of all rules. + + This option has lower precedence than rule and category overrides. """ + rules: Iterable[RulesetsExecuteRuleActionParametersOverridesRule] + """A list of rule-level overrides. This option has the highest precedence.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """A sensitivity level to set for all rules. + + This option has lower precedence than rule and category overrides and is only + applicable for DDoS phases. + """ + + +class RulesetsExecuteRuleActionParameters(TypedDict, total=False): + id: Required[str] + """The ID of the ruleset to execute.""" + + matched_data: RulesetsExecuteRuleActionParametersMatchedData + """The configuration to use for matched data logging.""" + + overrides: RulesetsExecuteRuleActionParametersOverrides + """A set of overrides to apply to the target ruleset.""" + + +class RulesetsExecuteRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsLogRule(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["log"] + """The action to perform when the rule matches.""" + + action_parameters: object + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsLogRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsLogRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsSkipRule(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["skip"] + """The action to perform when the rule matches.""" + + action_parameters: RulesetsSkipRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsSkipRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsSkipRuleActionParameters(TypedDict, total=False): + phases: List[ + Literal[ + "ddos_l4", + "ddos_l7", + "http_config_settings", + "http_custom_errors", + "http_log_custom_fields", + "http_ratelimit", + "http_request_cache_settings", + "http_request_dynamic_redirect", + "http_request_firewall_custom", + "http_request_firewall_managed", + "http_request_late_transform", + "http_request_origin", + "http_request_redirect", + "http_request_sanitize", + "http_request_sbfm", + "http_request_select_configuration", + "http_request_transform", + "http_response_compression", + "http_response_firewall_managed", + "http_response_headers_transform", + "magic_transit", + "magic_transit_ids_managed", + "magic_transit_managed", + ] + ] + """A list of phases to skip the execution of. + + This option is incompatible with the ruleset and rulesets options. + """ + + products: List[Literal["bic", "hot", "rateLimit", "securityLevel", "uaBlock", "waf", "zoneLockdown"]] + """A list of legacy security products to skip the execution of.""" + + rules: Dict[str, List[str]] + """ + A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the + execution of. This option is incompatible with the ruleset option. + """ + + ruleset: Literal["current"] + """A ruleset to skip the execution of. + + This option is incompatible with the rulesets, rules and phases options. + """ -class PositionAfterPosition(TypedDict, total=False): - after: str - """The ID of another rule to place the rule after. + rulesets: List[str] + """A list of ruleset IDs to skip the execution of. - An empty value causes the rule to be placed at the bottom. + This option is incompatible with the ruleset and phases options. """ -class PositionIndexPosition(TypedDict, total=False): - index: float - """An index at which to place the rule, where index 1 is the first rule.""" +class RulesetsSkipRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" -Position = Union[PositionBeforePosition, PositionAfterPosition, PositionIndexPosition] +RuleCreateParams = Union[RulesetsBlockRule, RulesetsExecuteRule, RulesetsLogRule, RulesetsSkipRule] diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 9696dcf4faf..4c92db407db 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -2,13 +2,31 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Literal, Required, TypedDict -__all__ = ["RuleEditParams", "Position", "PositionBeforePosition", "PositionAfterPosition", "PositionIndexPosition"] +__all__ = [ + "RuleEditParams", + "RulesetsBlockRule", + "RulesetsBlockRuleActionParameters", + "RulesetsBlockRuleActionParametersResponse", + "RulesetsBlockRuleLogging", + "RulesetsExecuteRule", + "RulesetsExecuteRuleActionParameters", + "RulesetsExecuteRuleActionParametersMatchedData", + "RulesetsExecuteRuleActionParametersOverrides", + "RulesetsExecuteRuleActionParametersOverridesCategory", + "RulesetsExecuteRuleActionParametersOverridesRule", + "RulesetsExecuteRuleLogging", + "RulesetsLogRule", + "RulesetsLogRuleLogging", + "RulesetsSkipRule", + "RulesetsSkipRuleActionParameters", + "RulesetsSkipRuleLogging", +] -class RuleEditParams(TypedDict, total=False): +class RulesetsBlockRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -18,29 +36,302 @@ class RuleEditParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - position: Position - """An object configuring where the rule will be placed.""" + id: str + """The unique ID of the rule.""" + action: Literal["block"] + """The action to perform when the rule matches.""" -class PositionBeforePosition(TypedDict, total=False): - before: str - """The ID of another rule to place the rule before. + action_parameters: RulesetsBlockRuleActionParameters + """The parameters configuring the rule's action.""" - An empty value causes the rule to be placed at the top. + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsBlockRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsBlockRuleActionParametersResponse(TypedDict, total=False): + content: Required[str] + """The content to return.""" + + content_type: Required[str] + """The type of the content to return.""" + + status_code: Required[int] + """The status code to return.""" + + +class RulesetsBlockRuleActionParameters(TypedDict, total=False): + response: RulesetsBlockRuleActionParametersResponse + """The response to show when the block is applied.""" + + +class RulesetsBlockRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsExecuteRule(TypedDict, total=False): + ruleset_id: Required[str] + """The unique ID of the ruleset.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["execute"] + """The action to perform when the rule matches.""" + + action_parameters: RulesetsExecuteRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsExecuteRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsExecuteRuleActionParametersMatchedData(TypedDict, total=False): + public_key: Required[str] + """The public key to encrypt matched data logs with.""" + + +class RulesetsExecuteRuleActionParametersOverridesCategory(TypedDict, total=False): + category: Required[str] + """The name of the category to override.""" + + action: str + """The action to override rules in the category with.""" + + enabled: bool + """Whether to enable execution of rules in the category.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """The sensitivity level to use for rules in the category.""" + + +class RulesetsExecuteRuleActionParametersOverridesRule(TypedDict, total=False): + id: Required[str] + """The ID of the rule to override.""" + + action: str + """The action to override the rule with.""" + + enabled: bool + """Whether to enable execution of the rule.""" + + score_threshold: int + """The score threshold to use for the rule.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """The sensitivity level to use for the rule.""" + + +class RulesetsExecuteRuleActionParametersOverrides(TypedDict, total=False): + action: str + """An action to override all rules with. + + This option has lower precedence than rule and category overrides. + """ + + categories: Iterable[RulesetsExecuteRuleActionParametersOverridesCategory] + """A list of category-level overrides. + + This option has the second-highest precedence after rule-level overrides. + """ + + enabled: bool + """Whether to enable execution of all rules. + + This option has lower precedence than rule and category overrides. + """ + + rules: Iterable[RulesetsExecuteRuleActionParametersOverridesRule] + """A list of rule-level overrides. This option has the highest precedence.""" + + sensitivity_level: Literal["default", "medium", "low", "eoff"] + """A sensitivity level to set for all rules. + + This option has lower precedence than rule and category overrides and is only + applicable for DDoS phases. """ -class PositionAfterPosition(TypedDict, total=False): - after: str - """The ID of another rule to place the rule after. +class RulesetsExecuteRuleActionParameters(TypedDict, total=False): + id: Required[str] + """The ID of the ruleset to execute.""" + + matched_data: RulesetsExecuteRuleActionParametersMatchedData + """The configuration to use for matched data logging.""" + + overrides: RulesetsExecuteRuleActionParametersOverrides + """A set of overrides to apply to the target ruleset.""" + + +class RulesetsExecuteRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsLogRule(TypedDict, total=False): + ruleset_id: Required[str] + """The unique ID of the ruleset.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["log"] + """The action to perform when the rule matches.""" + + action_parameters: object + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsLogRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsLogRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" + + +class RulesetsSkipRule(TypedDict, total=False): + ruleset_id: Required[str] + """The unique ID of the ruleset.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["skip"] + """The action to perform when the rule matches.""" + + action_parameters: RulesetsSkipRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: RulesetsSkipRuleLogging + """An object configuring the rule's logging behavior.""" + + ref: str + """The reference of the rule (the rule ID by default).""" + + +class RulesetsSkipRuleActionParameters(TypedDict, total=False): + phases: List[ + Literal[ + "ddos_l4", + "ddos_l7", + "http_config_settings", + "http_custom_errors", + "http_log_custom_fields", + "http_ratelimit", + "http_request_cache_settings", + "http_request_dynamic_redirect", + "http_request_firewall_custom", + "http_request_firewall_managed", + "http_request_late_transform", + "http_request_origin", + "http_request_redirect", + "http_request_sanitize", + "http_request_sbfm", + "http_request_select_configuration", + "http_request_transform", + "http_response_compression", + "http_response_firewall_managed", + "http_response_headers_transform", + "magic_transit", + "magic_transit_ids_managed", + "magic_transit_managed", + ] + ] + """A list of phases to skip the execution of. + + This option is incompatible with the ruleset and rulesets options. + """ + + products: List[Literal["bic", "hot", "rateLimit", "securityLevel", "uaBlock", "waf", "zoneLockdown"]] + """A list of legacy security products to skip the execution of.""" + + rules: Dict[str, List[str]] + """ + A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the + execution of. This option is incompatible with the ruleset option. + """ + + ruleset: Literal["current"] + """A ruleset to skip the execution of. + + This option is incompatible with the rulesets, rules and phases options. + """ + + rulesets: List[str] + """A list of ruleset IDs to skip the execution of. - An empty value causes the rule to be placed at the bottom. + This option is incompatible with the ruleset and phases options. """ -class PositionIndexPosition(TypedDict, total=False): - index: float - """An index at which to place the rule, where index 1 is the first rule.""" +class RulesetsSkipRuleLogging(TypedDict, total=False): + enabled: Required[bool] + """Whether to generate a log when the rule matches.""" -Position = Union[PositionBeforePosition, PositionAfterPosition, PositionIndexPosition] +RuleEditParams = Union[RulesetsBlockRule, RulesetsExecuteRule, RulesetsLogRule, RulesetsSkipRule] diff --git a/src/cloudflare/types/workers/ai_run_params.py b/src/cloudflare/types/workers/ai_run_params.py index 9ebf6e6efa4..7bb117df3a2 100644 --- a/src/cloudflare/types/workers/ai_run_params.py +++ b/src/cloudflare/types/workers/ai_run_params.py @@ -9,34 +9,35 @@ __all__ = [ "AIRunParams", - "Body", - "BodyTextClassification", - "BodyTextToImage", - "BodySentenceSimilarity", - "BodyTextEmbeddings", - "BodyAudio", - "BodyImageClassification", - "BodyObjectDetection", - "BodyUnionMember10", - "BodyUnionMember11", - "BodyUnionMember11Message", - "BodyTranslation", - "BodySummarization", - "BodyUnionMember15", + "TextClassification", + "TextToImage", + "SentenceSimilarity", + "TextEmbeddings", + "Variant4", + "Variant5", + "Variant6", + "Variant7", + "Variant8", + "Variant9", + "Variant10", + "Variant11", + "Variant11Message", + "Translation", + "Summarization", + "Variant14", + "Variant15", ] -class AIRunParams(TypedDict, total=False): +class TextClassification(TypedDict, total=False): account_id: Required[str] - body: Required[Body] - - -class BodyTextClassification(TypedDict, total=False): text: Required[str] -class BodyTextToImage(TypedDict, total=False): +class TextToImage(TypedDict, total=False): + account_id: Required[str] + prompt: Required[str] guidance: float @@ -50,29 +51,59 @@ class BodyTextToImage(TypedDict, total=False): strength: float -class BodySentenceSimilarity(TypedDict, total=False): +class SentenceSimilarity(TypedDict, total=False): + account_id: Required[str] + sentences: Required[List[str]] source: Required[str] -class BodyTextEmbeddings(TypedDict, total=False): +class TextEmbeddings(TypedDict, total=False): + account_id: Required[str] + text: Required[Union[str, List[str]]] -class BodyAudio(TypedDict, total=False): +class Variant4(TypedDict, total=False): + account_id: Required[str] + + body: Required[FileTypes] + + +class Variant5(TypedDict, total=False): + account_id: Required[str] + audio: Iterable[float] -class BodyImageClassification(TypedDict, total=False): +class Variant6(TypedDict, total=False): + account_id: Required[str] + + body: Required[FileTypes] + + +class Variant7(TypedDict, total=False): + account_id: Required[str] + image: Iterable[float] -class BodyObjectDetection(TypedDict, total=False): +class Variant8(TypedDict, total=False): + account_id: Required[str] + + body: Required[FileTypes] + + +class Variant9(TypedDict, total=False): + account_id: Required[str] + image: Iterable[float] -class BodyUnionMember10(TypedDict, total=False): +class Variant10(TypedDict, total=False): + account_id: Required[str] + prompt: Required[str] lora: str @@ -84,21 +115,25 @@ class BodyUnionMember10(TypedDict, total=False): stream: bool -class BodyUnionMember11Message(TypedDict, total=False): - content: Required[str] - - role: Required[str] - +class Variant11(TypedDict, total=False): + account_id: Required[str] -class BodyUnionMember11(TypedDict, total=False): - messages: Required[Iterable[BodyUnionMember11Message]] + messages: Required[Iterable[Variant11Message]] max_tokens: int stream: bool -class BodyTranslation(TypedDict, total=False): +class Variant11Message(TypedDict, total=False): + content: Required[str] + + role: Required[str] + + +class Translation(TypedDict, total=False): + account_id: Required[str] + target_lang: Required[str] text: Required[str] @@ -106,13 +141,23 @@ class BodyTranslation(TypedDict, total=False): source_lang: str -class BodySummarization(TypedDict, total=False): +class Summarization(TypedDict, total=False): + account_id: Required[str] + input_text: Required[str] max_length: int -class BodyUnionMember15(TypedDict, total=False): +class Variant14(TypedDict, total=False): + account_id: Required[str] + + body: Required[FileTypes] + + +class Variant15(TypedDict, total=False): + account_id: Required[str] + image: Iterable[float] max_tokens: int @@ -120,21 +165,21 @@ class BodyUnionMember15(TypedDict, total=False): prompt: str -Body = Union[ - BodyTextClassification, - BodyTextToImage, - BodySentenceSimilarity, - BodyTextEmbeddings, - FileTypes, - BodyAudio, - FileTypes, - BodyImageClassification, - FileTypes, - BodyObjectDetection, - BodyUnionMember10, - BodyUnionMember11, - BodyTranslation, - BodySummarization, - FileTypes, - BodyUnionMember15, +AIRunParams = Union[ + TextClassification, + TextToImage, + SentenceSimilarity, + TextEmbeddings, + Variant4, + Variant5, + Variant6, + Variant7, + Variant8, + Variant9, + Variant10, + Variant11, + Translation, + Summarization, + Variant14, + Variant15, ] diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index b64ef9ab491..f5d078c31e2 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -10,21 +10,23 @@ __all__ = [ "ScriptUpdateParams", - "Metadata", - "MetadataMigrations", - "MetadataMigrationsWorkersSingleStepMigrations", - "MetadataMigrationsWorkersSingleStepMigrationsRenamedClass", - "MetadataMigrationsWorkersSingleStepMigrationsTransferredClass", - "MetadataMigrationsWorkersSteppedMigrations", - "MetadataMigrationsWorkersSteppedMigrationsStep", - "MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass", - "MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass", - "MetadataPlacement", - "MetadataTailConsumer", + "Variant0", + "Variant0Metadata", + "Variant0MetadataMigrations", + "Variant0MetadataMigrationsWorkersSingleStepMigrations", + "Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass", + "Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass", + "Variant0MetadataMigrationsWorkersSteppedMigrations", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStep", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass", + "Variant0MetadataPlacement", + "Variant0MetadataTailConsumer", + "Variant1", ] -class ScriptUpdateParams(TypedDict, total=False): +class Variant0(TypedDict, total=False): account_id: Required[str] """Identifier""" @@ -44,18 +46,12 @@ class ScriptUpdateParams(TypedDict, total=False): `body_part` by part name. """ - message: str - """Rollback message to be associated with this deployment. - - Only parsed when query param `"rollback_to"` is present. - """ - - metadata: Metadata + metadata: Variant0Metadata """JSON encoded metadata about the uploaded parts and Worker configuration.""" -_MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", { "from": str, }, @@ -63,14 +59,14 @@ class ScriptUpdateParams(TypedDict, total=False): ) -class MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( - _MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( + _Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False ): to: str -_MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", { "from": str, }, @@ -78,15 +74,15 @@ class MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( ) -class MetadataMigrationsWorkersSingleStepMigrationsTransferredClass( - _MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass( + _Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False ): from_script: str to: str -class MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" @@ -102,18 +98,18 @@ class MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): If they don't match, the upload is rejected. """ - renamed_classes: Iterable[MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] + renamed_classes: Iterable[Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] + transferred_classes: Iterable[Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -_MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", { "from": str, }, @@ -121,14 +117,14 @@ class to a class defined in this Worker. ) -class MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( - _MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( + _Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False ): to: str -_MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", { "from": str, }, @@ -136,32 +132,32 @@ class MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( ) -class MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass( - _MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass( + _Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False ): from_script: str to: str -class MetadataMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" new_classes: List[str] """A list of classes to create Durable Object namespaces from.""" - renamed_classes: Iterable[MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass] + renamed_classes: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass] + transferred_classes: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -class MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): new_tag: str """Tag to set as the latest migration tag.""" @@ -171,14 +167,16 @@ class MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): If they don't match, the upload is rejected. """ - steps: Iterable[MetadataMigrationsWorkersSteppedMigrationsStep] + steps: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStep] """Migrations to apply in order.""" -MetadataMigrations = Union[MetadataMigrationsWorkersSingleStepMigrations, MetadataMigrationsWorkersSteppedMigrations] +Variant0MetadataMigrations = Union[ + Variant0MetadataMigrationsWorkersSingleStepMigrations, Variant0MetadataMigrationsWorkersSteppedMigrations +] -class MetadataPlacement(TypedDict, total=False): +class Variant0MetadataPlacement(TypedDict, total=False): mode: Literal["smart"] """ Enables @@ -187,7 +185,7 @@ class MetadataPlacement(TypedDict, total=False): """ -class MetadataTailConsumer(TypedDict, total=False): +class Variant0MetadataTailConsumer(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" @@ -198,7 +196,7 @@ class MetadataTailConsumer(TypedDict, total=False): """Optional dispatch namespace the script belongs to.""" -class Metadata(TypedDict, total=False): +class Variant0Metadata(TypedDict, total=False): bindings: Iterable[object] """List of bindings available to the worker.""" @@ -235,15 +233,15 @@ class Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: MetadataMigrations + migrations: Variant0MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - placement: MetadataPlacement + placement: Variant0MetadataPlacement tags: List[str] """List of strings to use as tags for this Worker""" - tail_consumers: Iterable[MetadataTailConsumer] + tail_consumers: Iterable[Variant0MetadataTailConsumer] """List of Workers that will consume logs from the attached Worker.""" usage_model: Literal["bundled", "unbound"] @@ -251,3 +249,25 @@ class Metadata(TypedDict, total=False): version_tags: object """Key-value pairs to use as tags for this version of this Worker""" + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + rollback_to: str + """Rollback to provided deployment based on deployment ID. + + Request body will only parse a "message" part. You can learn more about + deployments + [here](https://developers.cloudflare.com/workers/platform/deployments/). + """ + + message: str + """Rollback message to be associated with this deployment. + + Only parsed when query param `"rollback_to"` is present. + """ + + +ScriptUpdateParams = Union[Variant0, Variant1] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 7d0b401d31f..a0117316558 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -10,21 +10,23 @@ __all__ = [ "ScriptUpdateParams", - "Metadata", - "MetadataMigrations", - "MetadataMigrationsWorkersSingleStepMigrations", - "MetadataMigrationsWorkersSingleStepMigrationsRenamedClass", - "MetadataMigrationsWorkersSingleStepMigrationsTransferredClass", - "MetadataMigrationsWorkersSteppedMigrations", - "MetadataMigrationsWorkersSteppedMigrationsStep", - "MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass", - "MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass", - "MetadataPlacement", - "MetadataTailConsumer", + "Variant0", + "Variant0Metadata", + "Variant0MetadataMigrations", + "Variant0MetadataMigrationsWorkersSingleStepMigrations", + "Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass", + "Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass", + "Variant0MetadataMigrationsWorkersSteppedMigrations", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStep", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass", + "Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass", + "Variant0MetadataPlacement", + "Variant0MetadataTailConsumer", + "Variant1", ] -class ScriptUpdateParams(TypedDict, total=False): +class Variant0(TypedDict, total=False): account_id: Required[str] """Identifier""" @@ -39,18 +41,12 @@ class ScriptUpdateParams(TypedDict, total=False): `body_part` by part name. """ - message: str - """Rollback message to be associated with this deployment. - - Only parsed when query param `"rollback_to"` is present. - """ - - metadata: Metadata + metadata: Variant0Metadata """JSON encoded metadata about the uploaded parts and Worker configuration.""" -_MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords", { "from": str, }, @@ -58,14 +54,14 @@ class ScriptUpdateParams(TypedDict, total=False): ) -class MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( - _MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( + _Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords, total=False ): to: str -_MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords", { "from": str, }, @@ -73,15 +69,15 @@ class MetadataMigrationsWorkersSingleStepMigrationsRenamedClass( ) -class MetadataMigrationsWorkersSingleStepMigrationsTransferredClass( - _MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass( + _Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClassReservedKeywords, total=False ): from_script: str to: str -class MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" @@ -97,18 +93,18 @@ class MetadataMigrationsWorkersSingleStepMigrations(TypedDict, total=False): If they don't match, the upload is rejected. """ - renamed_classes: Iterable[MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] + renamed_classes: Iterable[Variant0MetadataMigrationsWorkersSingleStepMigrationsRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] + transferred_classes: Iterable[Variant0MetadataMigrationsWorkersSingleStepMigrationsTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -_MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords", { "from": str, }, @@ -116,14 +112,14 @@ class to a class defined in this Worker. ) -class MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( - _MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( + _Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClassReservedKeywords, total=False ): to: str -_MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( - "_MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", +_Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords = TypedDict( + "_Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords", { "from": str, }, @@ -131,32 +127,32 @@ class MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass( ) -class MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass( - _MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False +class Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass( + _Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClassReservedKeywords, total=False ): from_script: str to: str -class MetadataMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSteppedMigrationsStep(TypedDict, total=False): deleted_classes: List[str] """A list of classes to delete Durable Object namespaces from.""" new_classes: List[str] """A list of classes to create Durable Object namespaces from.""" - renamed_classes: Iterable[MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass] + renamed_classes: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStepRenamedClass] """A list of classes with Durable Object namespaces that were renamed.""" - transferred_classes: Iterable[MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass] + transferred_classes: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStepTransferredClass] """ A list of transfers for Durable Object namespaces from a different Worker and class to a class defined in this Worker. """ -class MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): +class Variant0MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): new_tag: str """Tag to set as the latest migration tag.""" @@ -166,14 +162,16 @@ class MetadataMigrationsWorkersSteppedMigrations(TypedDict, total=False): If they don't match, the upload is rejected. """ - steps: Iterable[MetadataMigrationsWorkersSteppedMigrationsStep] + steps: Iterable[Variant0MetadataMigrationsWorkersSteppedMigrationsStep] """Migrations to apply in order.""" -MetadataMigrations = Union[MetadataMigrationsWorkersSingleStepMigrations, MetadataMigrationsWorkersSteppedMigrations] +Variant0MetadataMigrations = Union[ + Variant0MetadataMigrationsWorkersSingleStepMigrations, Variant0MetadataMigrationsWorkersSteppedMigrations +] -class MetadataPlacement(TypedDict, total=False): +class Variant0MetadataPlacement(TypedDict, total=False): mode: Literal["smart"] """ Enables @@ -182,7 +180,7 @@ class MetadataPlacement(TypedDict, total=False): """ -class MetadataTailConsumer(TypedDict, total=False): +class Variant0MetadataTailConsumer(TypedDict, total=False): service: Required[str] """Name of Worker that is to be the consumer.""" @@ -193,7 +191,7 @@ class MetadataTailConsumer(TypedDict, total=False): """Optional dispatch namespace the script belongs to.""" -class Metadata(TypedDict, total=False): +class Variant0Metadata(TypedDict, total=False): bindings: Iterable[object] """List of bindings available to the worker.""" @@ -230,15 +228,15 @@ class Metadata(TypedDict, total=False): the file exporting a `fetch` handler). Indicates a `module syntax` Worker. """ - migrations: MetadataMigrations + migrations: Variant0MetadataMigrations """Migrations to apply for Durable Objects associated with this Worker.""" - placement: MetadataPlacement + placement: Variant0MetadataPlacement tags: List[str] """List of strings to use as tags for this Worker""" - tail_consumers: Iterable[MetadataTailConsumer] + tail_consumers: Iterable[Variant0MetadataTailConsumer] """List of Workers that will consume logs from the attached Worker.""" usage_model: Literal["bundled", "unbound"] @@ -246,3 +244,20 @@ class Metadata(TypedDict, total=False): version_tags: object """Key-value pairs to use as tags for this version of this Worker""" + + +class Variant1(TypedDict, total=False): + account_id: Required[str] + """Identifier""" + + dispatch_namespace: Required[str] + """Name of the Workers for Platforms dispatch namespace.""" + + message: str + """Rollback message to be associated with this deployment. + + Only parsed when query param `"rollback_to"` is present. + """ + + +ScriptUpdateParams = Union[Variant0, Variant1] 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 9a726e901e3..e1d47050dff 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -3,20 +3,40 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = [ "ApplicationCreateParams", - "CorsHeaders", - "SaasApp", - "SaasAppAccessSamlSaasApp", - "SaasAppAccessSamlSaasAppCustomAttributes", - "SaasAppAccessSamlSaasAppCustomAttributesSource", - "SaasAppAccessOidcSaasApp", + "SelfHostedApplication", + "SelfHostedApplicationCorsHeaders", + "SaaSApplication", + "SaaSApplicationSaasApp", + "SaaSApplicationSaasAppAccessSamlSaasApp", + "SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes", + "SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource", + "SaaSApplicationSaasAppAccessOidcSaasApp", + "BrowserSSHApplication", + "BrowserSSHApplicationCorsHeaders", + "BrowserVncApplication", + "BrowserVncApplicationCorsHeaders", + "AppLauncherApplication", + "DeviceEnrollmentPermissionsApplication", + "BrowserIsolationPermissionsApplication", + "BookmarkApplication", ] -class ApplicationCreateParams(TypedDict, total=False): +class SelfHostedApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -38,7 +58,8 @@ class ApplicationCreateParams(TypedDict, total=False): Defaults to all IdPs configured in your account. """ - app_launcher_visible: object + app_launcher_visible: bool + """Displays the application in the App Launcher.""" auto_redirect_to_identity: bool """When set to `true`, users skip the identity provider selection step during @@ -47,7 +68,7 @@ class ApplicationCreateParams(TypedDict, total=False): You must specify only one identity provider in allowed_idps. """ - cors_headers: CorsHeaders + cors_headers: SelfHostedApplicationCorsHeaders custom_deny_message: str """ @@ -70,9 +91,6 @@ class ApplicationCreateParams(TypedDict, total=False): custom_pages: List[str] """The custom pages that will be displayed when applicable for this application""" - domain: object - """The URL or domain of the bookmark.""" - enable_binding_cookie: bool """ Enables the binding cookie, which increases security against compromised @@ -97,8 +115,6 @@ class ApplicationCreateParams(TypedDict, total=False): If disabled, the JWT will scope to the hostname by default """ - saas_app: SaasApp - same_site_cookie_attribute: str """ Sets the SameSite cookie setting, which provides increased security against CSRF @@ -127,11 +143,8 @@ class ApplicationCreateParams(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - """The application type.""" - -class CorsHeaders(TypedDict, total=False): +class SelfHostedApplicationCorsHeaders(TypedDict, total=False): allow_all_headers: bool """Allows all HTTP request headers.""" @@ -160,12 +173,57 @@ class CorsHeaders(TypedDict, total=False): """The maximum number of seconds the results of a preflight request can be cached.""" -class SaasAppAccessSamlSaasAppCustomAttributesSource(TypedDict, total=False): +class SaaSApplication(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + saas_app: SaaSApplicationSaasApp + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + type: str + """The application type.""" + + +class SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource(TypedDict, total=False): name: str """The name of the IdP attribute.""" -class SaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): +class SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): name: str """The name of the attribute.""" @@ -176,10 +234,10 @@ class SaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): ] """A globally unique name for an identity or service provider.""" - source: SaasAppAccessSamlSaasAppCustomAttributesSource + source: SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource -class SaasAppAccessSamlSaasApp(TypedDict, total=False): +class SaaSApplicationSaasAppAccessSamlSaasApp(TypedDict, total=False): auth_type: Literal["saml", "oidc"] """Optional identifier indicating the authentication protocol used for the saas app. @@ -193,7 +251,7 @@ class SaasAppAccessSamlSaasApp(TypedDict, total=False): SAML assertion. """ - custom_attributes: SaasAppAccessSamlSaasAppCustomAttributes + custom_attributes: SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes default_relay_state: str """ @@ -225,7 +283,7 @@ class SaasAppAccessSamlSaasApp(TypedDict, total=False): """The endpoint where your SaaS application will send login requests.""" -class SaasAppAccessOidcSaasApp(TypedDict, total=False): +class SaaSApplicationSaasAppAccessOidcSaasApp(TypedDict, total=False): app_launcher_url: str """The URL where this applications tile redirects users""" @@ -260,4 +318,434 @@ class SaasAppAccessOidcSaasApp(TypedDict, total=False): """Define the user information shared with access""" -SaasApp = Union[SaasAppAccessSamlSaasApp, SaasAppAccessOidcSaasApp] +SaaSApplicationSaasApp = Union[SaaSApplicationSaasAppAccessSamlSaasApp, SaaSApplicationSaasAppAccessOidcSaasApp] + + +class BrowserSSHApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + cors_headers: BrowserSSHApplicationCorsHeaders + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + enable_binding_cookie: bool + """ + Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + path_cookie_attribute: bool + """Enables cookie paths to scope an application's JWT to the application path. + + If disabled, the JWT will scope to the hostname by default + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + self_hosted_domains: List[str] + """List of domains that Access will secure.""" + + service_auth_401_redirect: bool + """Returns a 401 status code when the request is blocked by a Service Auth policy.""" + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + skip_interstitial: bool + """Enables automatic authentication through cloudflared.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class BrowserSSHApplicationCorsHeaders(TypedDict, total=False): + allow_all_headers: bool + """Allows all HTTP request headers.""" + + allow_all_methods: bool + """Allows all HTTP request methods.""" + + allow_all_origins: bool + """Allows all origins.""" + + allow_credentials: bool + """ + When set to `true`, includes credentials (cookies, authorization headers, or TLS + client certificates) with requests. + """ + + allowed_headers: Iterable[object] + """Allowed HTTP request headers.""" + + allowed_methods: List[Literal["GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]] + """Allowed HTTP request methods.""" + + allowed_origins: Iterable[object] + """Allowed origins.""" + + max_age: float + """The maximum number of seconds the results of a preflight request can be cached.""" + + +class BrowserVncApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + cors_headers: BrowserVncApplicationCorsHeaders + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + enable_binding_cookie: bool + """ + Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + path_cookie_attribute: bool + """Enables cookie paths to scope an application's JWT to the application path. + + If disabled, the JWT will scope to the hostname by default + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + self_hosted_domains: List[str] + """List of domains that Access will secure.""" + + service_auth_401_redirect: bool + """Returns a 401 status code when the request is blocked by a Service Auth policy.""" + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + skip_interstitial: bool + """Enables automatic authentication through cloudflared.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class BrowserVncApplicationCorsHeaders(TypedDict, total=False): + allow_all_headers: bool + """Allows all HTTP request headers.""" + + allow_all_methods: bool + """Allows all HTTP request methods.""" + + allow_all_origins: bool + """Allows all origins.""" + + allow_credentials: bool + """ + When set to `true`, includes credentials (cookies, authorization headers, or TLS + client certificates) with requests. + """ + + allowed_headers: Iterable[object] + """Allowed HTTP request headers.""" + + allowed_methods: List[Literal["GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]] + """Allowed HTTP request methods.""" + + allowed_origins: Iterable[object] + """Allowed origins.""" + + max_age: float + """The maximum number of seconds the results of a preflight request can be cached.""" + + +class AppLauncherApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class DeviceEnrollmentPermissionsApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserIsolationPermissionsApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class BookmarkApplication(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + app_launcher_visible: object + + domain: object + """The URL or domain of the bookmark.""" + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + type: str + """The application type.""" + + +ApplicationCreateParams = Union[ + SelfHostedApplication, + SaaSApplication, + BrowserSSHApplication, + BrowserVncApplication, + AppLauncherApplication, + DeviceEnrollmentPermissionsApplication, + BrowserIsolationPermissionsApplication, + BookmarkApplication, +] 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 161aeb8adc6..bb4ed561281 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -3,20 +3,40 @@ from __future__ import annotations from typing import List, Union, Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = [ "ApplicationUpdateParams", - "CorsHeaders", - "SaasApp", - "SaasAppAccessSamlSaasApp", - "SaasAppAccessSamlSaasAppCustomAttributes", - "SaasAppAccessSamlSaasAppCustomAttributesSource", - "SaasAppAccessOidcSaasApp", + "SelfHostedApplication", + "SelfHostedApplicationCorsHeaders", + "SaaSApplication", + "SaaSApplicationSaasApp", + "SaaSApplicationSaasAppAccessSamlSaasApp", + "SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes", + "SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource", + "SaaSApplicationSaasAppAccessOidcSaasApp", + "BrowserSSHApplication", + "BrowserSSHApplicationCorsHeaders", + "BrowserVncApplication", + "BrowserVncApplicationCorsHeaders", + "AppLauncherApplication", + "DeviceEnrollmentPermissionsApplication", + "BrowserIsolationPermissionsApplication", + "BookmarkApplication", ] -class ApplicationUpdateParams(TypedDict, total=False): +class SelfHostedApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -38,7 +58,8 @@ class ApplicationUpdateParams(TypedDict, total=False): Defaults to all IdPs configured in your account. """ - app_launcher_visible: object + app_launcher_visible: bool + """Displays the application in the App Launcher.""" auto_redirect_to_identity: bool """When set to `true`, users skip the identity provider selection step during @@ -47,7 +68,7 @@ class ApplicationUpdateParams(TypedDict, total=False): You must specify only one identity provider in allowed_idps. """ - cors_headers: CorsHeaders + cors_headers: SelfHostedApplicationCorsHeaders custom_deny_message: str """ @@ -70,9 +91,6 @@ class ApplicationUpdateParams(TypedDict, total=False): custom_pages: List[str] """The custom pages that will be displayed when applicable for this application""" - domain: object - """The URL or domain of the bookmark.""" - enable_binding_cookie: bool """ Enables the binding cookie, which increases security against compromised @@ -97,8 +115,6 @@ class ApplicationUpdateParams(TypedDict, total=False): If disabled, the JWT will scope to the hostname by default """ - saas_app: SaasApp - same_site_cookie_attribute: str """ Sets the SameSite cookie setting, which provides increased security against CSRF @@ -127,11 +143,8 @@ class ApplicationUpdateParams(TypedDict, total=False): Tags are used to filter applications in the App Launcher dashboard. """ - type: Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"] - """The application type.""" - -class CorsHeaders(TypedDict, total=False): +class SelfHostedApplicationCorsHeaders(TypedDict, total=False): allow_all_headers: bool """Allows all HTTP request headers.""" @@ -160,12 +173,57 @@ class CorsHeaders(TypedDict, total=False): """The maximum number of seconds the results of a preflight request can be cached.""" -class SaasAppAccessSamlSaasAppCustomAttributesSource(TypedDict, total=False): +class SaaSApplication(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + saas_app: SaaSApplicationSaasApp + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + type: str + """The application type.""" + + +class SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource(TypedDict, total=False): name: str """The name of the IdP attribute.""" -class SaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): +class SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): name: str """The name of the attribute.""" @@ -176,10 +234,10 @@ class SaasAppAccessSamlSaasAppCustomAttributes(TypedDict, total=False): ] """A globally unique name for an identity or service provider.""" - source: SaasAppAccessSamlSaasAppCustomAttributesSource + source: SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributesSource -class SaasAppAccessSamlSaasApp(TypedDict, total=False): +class SaaSApplicationSaasAppAccessSamlSaasApp(TypedDict, total=False): auth_type: Literal["saml", "oidc"] """Optional identifier indicating the authentication protocol used for the saas app. @@ -193,7 +251,7 @@ class SaasAppAccessSamlSaasApp(TypedDict, total=False): SAML assertion. """ - custom_attributes: SaasAppAccessSamlSaasAppCustomAttributes + custom_attributes: SaaSApplicationSaasAppAccessSamlSaasAppCustomAttributes default_relay_state: str """ @@ -225,7 +283,7 @@ class SaasAppAccessSamlSaasApp(TypedDict, total=False): """The endpoint where your SaaS application will send login requests.""" -class SaasAppAccessOidcSaasApp(TypedDict, total=False): +class SaaSApplicationSaasAppAccessOidcSaasApp(TypedDict, total=False): app_launcher_url: str """The URL where this applications tile redirects users""" @@ -260,4 +318,434 @@ class SaasAppAccessOidcSaasApp(TypedDict, total=False): """Define the user information shared with access""" -SaasApp = Union[SaasAppAccessSamlSaasApp, SaasAppAccessOidcSaasApp] +SaaSApplicationSaasApp = Union[SaaSApplicationSaasAppAccessSamlSaasApp, SaaSApplicationSaasAppAccessOidcSaasApp] + + +class BrowserSSHApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + cors_headers: BrowserSSHApplicationCorsHeaders + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + enable_binding_cookie: bool + """ + Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + path_cookie_attribute: bool + """Enables cookie paths to scope an application's JWT to the application path. + + If disabled, the JWT will scope to the hostname by default + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + self_hosted_domains: List[str] + """List of domains that Access will secure.""" + + service_auth_401_redirect: bool + """Returns a 401 status code when the request is blocked by a Service Auth policy.""" + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + skip_interstitial: bool + """Enables automatic authentication through cloudflared.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class BrowserSSHApplicationCorsHeaders(TypedDict, total=False): + allow_all_headers: bool + """Allows all HTTP request headers.""" + + allow_all_methods: bool + """Allows all HTTP request methods.""" + + allow_all_origins: bool + """Allows all origins.""" + + allow_credentials: bool + """ + When set to `true`, includes credentials (cookies, authorization headers, or TLS + client certificates) with requests. + """ + + allowed_headers: Iterable[object] + """Allowed HTTP request headers.""" + + allowed_methods: List[Literal["GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]] + """Allowed HTTP request methods.""" + + allowed_origins: Iterable[object] + """Allowed origins.""" + + max_age: float + """The maximum number of seconds the results of a preflight request can be cached.""" + + +class BrowserVncApplication(TypedDict, total=False): + domain: Required[str] + """The primary hostname and path that Access will secure. + + If the app is visible in the App Launcher dashboard, this is the domain that + will be displayed. + """ + + type: Required[str] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + app_launcher_visible: bool + """Displays the application in the App Launcher.""" + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + cors_headers: BrowserVncApplicationCorsHeaders + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: List[str] + """The custom pages that will be displayed when applicable for this application""" + + enable_binding_cookie: bool + """ + Enables the binding cookie, which increases security against compromised + authorization tokens and CSRF attacks. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + path_cookie_attribute: bool + """Enables cookie paths to scope an application's JWT to the application path. + + If disabled, the JWT will scope to the hostname by default + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + self_hosted_domains: List[str] + """List of domains that Access will secure.""" + + service_auth_401_redirect: bool + """Returns a 401 status code when the request is blocked by a Service Auth policy.""" + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + skip_interstitial: bool + """Enables automatic authentication through cloudflared.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class BrowserVncApplicationCorsHeaders(TypedDict, total=False): + allow_all_headers: bool + """Allows all HTTP request headers.""" + + allow_all_methods: bool + """Allows all HTTP request methods.""" + + allow_all_origins: bool + """Allows all origins.""" + + allow_credentials: bool + """ + When set to `true`, includes credentials (cookies, authorization headers, or TLS + client certificates) with requests. + """ + + allowed_headers: Iterable[object] + """Allowed HTTP request headers.""" + + allowed_methods: List[Literal["GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]] + """Allowed HTTP request methods.""" + + allowed_origins: Iterable[object] + """Allowed origins.""" + + max_age: float + """The maximum number of seconds the results of a preflight request can be cached.""" + + +class AppLauncherApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class DeviceEnrollmentPermissionsApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserIsolationPermissionsApplication(TypedDict, total=False): + type: Required[Literal["self_hosted", "saas", "ssh", "vnc", "app_launcher", "warp", "biso", "bookmark", "dash_sso"]] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allowed_idps: List[str] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +class BookmarkApplication(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + app_launcher_visible: object + + domain: object + """The URL or domain of the bookmark.""" + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + tags: List[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + type: str + """The application type.""" + + +ApplicationUpdateParams = Union[ + SelfHostedApplication, + SaaSApplication, + BrowserSSHApplication, + BrowserVncApplication, + AppLauncherApplication, + DeviceEnrollmentPermissionsApplication, + BrowserIsolationPermissionsApplication, + BookmarkApplication, +] diff --git a/src/cloudflare/types/zero_trust/identity_provider_create_params.py b/src/cloudflare/types/zero_trust/identity_provider_create_params.py index a96df64814d..1361f7a999c 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_create_params.py +++ b/src/cloudflare/types/zero_trust/identity_provider_create_params.py @@ -2,14 +2,63 @@ from __future__ import annotations -from typing import List, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["IdentityProviderCreateParams", "Config", "ConfigHeaderAttribute", "ScimConfig"] +__all__ = [ + "IdentityProviderCreateParams", + "AccessAzureAd", + "AccessAzureAdConfig", + "AccessAzureAdScimConfig", + "AccessCentrify", + "AccessCentrifyConfig", + "AccessCentrifyScimConfig", + "AccessFacebook", + "AccessFacebookConfig", + "AccessFacebookScimConfig", + "AccessGitHub", + "AccessGitHubConfig", + "AccessGitHubScimConfig", + "AccessGoogle", + "AccessGoogleConfig", + "AccessGoogleScimConfig", + "AccessGoogleApps", + "AccessGoogleAppsConfig", + "AccessGoogleAppsScimConfig", + "AccessLinkedin", + "AccessLinkedinConfig", + "AccessLinkedinScimConfig", + "AccessOidc", + "AccessOidcConfig", + "AccessOidcScimConfig", + "AccessOkta", + "AccessOktaConfig", + "AccessOktaScimConfig", + "AccessOnelogin", + "AccessOneloginConfig", + "AccessOneloginScimConfig", + "AccessPingone", + "AccessPingoneConfig", + "AccessPingoneScimConfig", + "AccessSaml", + "AccessSamlConfig", + "AccessSamlConfigHeaderAttribute", + "AccessSamlScimConfig", + "AccessYandex", + "AccessYandexConfig", + "AccessYandexScimConfig", + "AccessOnetimepin", + "AccessOnetimepinScimConfig", +] -class IdentityProviderCreateParams(TypedDict, total=False): - config: Required[Config] +class AccessAzureAd(TypedDict, total=False): + config: Required[AccessAzureAdConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ name: Required[str] """The name of the identity provider, shown to users on the login page.""" @@ -44,42 +93,136 @@ class IdentityProviderCreateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - scim_config: ScimConfig + scim_config: AccessAzureAdScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ -class ConfigHeaderAttribute(TypedDict, total=False): - attribute_name: str - """attribute name from the IDP""" +class AccessAzureAdConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" - header_name: str - """header that will be added on the request to the origin""" + client_id: str + """Your OAuth Client ID""" + client_secret: str + """Your OAuth Client Secret""" -class Config(TypedDict, total=False): - apps_domain: str - """Your companies TLD""" + conditional_access_enabled: bool + """Should Cloudflare try to load authentication contexts from your account""" - attributes: List[str] + directory_id: str + """Your Azure directory uuid""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + prompt: Literal["login", "select_account", "none"] + """Indicates the type of user interaction that is required. + + prompt=login forces the user to enter their credentials on that request, + negating single-sign on. prompt=none is the opposite. It ensures that the user + isn't presented with any interactive prompt. If the request can't be completed + silently by using single-sign on, the Microsoft identity platform returns an + interaction_required error. prompt=select_account interrupts single sign-on + providing account selection experience listing all the accounts either in + session or any remembered account or an option to choose to use a different + account altogether. """ - A list of SAML attribute names that will be added to your signed JWT token and - can be used in SAML policy rules. + + support_groups: bool + """Should Cloudflare try to load groups from your account""" + + +class AccessAzureAdScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. """ - auth_url: str - """The authorization_endpoint URL of your IdP""" + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ - authorization_server_id: str - """Your okta authorization server id""" + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessCentrify(TypedDict, total=False): + config: Required[AccessCentrifyConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + scim_config: AccessCentrifyScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessCentrifyConfig(TypedDict, total=False): centrify_account: str """Your centrify account url""" centrify_app_id: str """Your centrify app id""" - certs_url: str - """The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens""" - claims: List[str] """Custom claims""" @@ -89,72 +232,99 @@ class Config(TypedDict, total=False): client_secret: str """Your OAuth Client Secret""" - conditional_access_enabled: bool - """Should Cloudflare try to load authentication contexts from your account""" + email_claim_name: str + """The claim name for email in the id_token response.""" - directory_id: str - """Your Azure directory uuid""" - email_attribute_name: str - """The attribute name for email in the SAML response.""" +class AccessCentrifyScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" - email_claim_name: str - """The claim name for email in the id_token response.""" + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ - header_attributes: Iterable[ConfigHeaderAttribute] + seat_deprovision: bool """ - Add a list of attribute names that will be returned in the response header from - the Access callback. + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. """ - idp_public_certs: List[str] - """X509 certificate to verify the signature in the SAML authentication response""" + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ - issuer_url: str - """IdP Entity ID or Issuer URL""" + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ - okta_account: str - """Your okta account url""" - onelogin_account: str - """Your OneLogin account url""" +class AccessFacebook(TypedDict, total=False): + config: Required[AccessFacebookConfig] + """The configuration parameters for the identity provider. - ping_env_id: str - """Your PingOne environment identifier""" + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ - prompt: Literal["login", "select_account", "none"] - """Indicates the type of user interaction that is required. + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" - prompt=login forces the user to enter their credentials on that request, - negating single-sign on. prompt=none is the opposite. It ensures that the user - isn't presented with any interactive prompt. If the request can't be completed - silently by using single-sign on, the Microsoft identity platform returns an - interaction_required error. prompt=select_account interrupts single sign-on - providing account selection experience listing all the accounts either in - session or any remembered account or an option to choose to use a different - account altogether. + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). """ - scopes: List[str] - """OAuth scopes""" + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" - sign_request: bool - """Sign the SAML authentication request with Access credentials. + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - To verify the signature, use the public key from the Access certs endpoints. + scim_config: AccessFacebookScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. """ - sso_target_url: str - """URL to send the SAML authentication requests to""" - support_groups: bool - """Should Cloudflare try to load groups from your account""" +class AccessFacebookConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" - token_url: str - """The token_endpoint URL of your IdP""" + client_secret: str + """Your OAuth Client Secret""" -class ScimConfig(TypedDict, total=False): +class AccessFacebookScimConfig(TypedDict, total=False): enabled: bool """A flag to enable or disable SCIM for the identity provider.""" @@ -184,3 +354,1076 @@ class ScimConfig(TypedDict, total=False): A flag to enable revoking a user's session in Access and Gateway when they have been deprovisioned in the Identity Provider. """ + + +class AccessGitHub(TypedDict, total=False): + config: Required[AccessGitHubConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGitHubScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGitHubConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessGitHubScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessGoogle(TypedDict, total=False): + config: Required[AccessGoogleConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGoogleScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGoogleConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + +class AccessGoogleScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessGoogleApps(TypedDict, total=False): + config: Required[AccessGoogleAppsConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGoogleAppsScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGoogleAppsConfig(TypedDict, total=False): + apps_domain: str + """Your companies TLD""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + +class AccessGoogleAppsScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessLinkedin(TypedDict, total=False): + config: Required[AccessLinkedinConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessLinkedinScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessLinkedinConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessLinkedinScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOidc(TypedDict, total=False): + config: Required[AccessOidcConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOidcScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOidcConfig(TypedDict, total=False): + auth_url: str + """The authorization_endpoint URL of your IdP""" + + certs_url: str + """The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + scopes: List[str] + """OAuth scopes""" + + token_url: str + """The token_endpoint URL of your IdP""" + + +class AccessOidcScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOkta(TypedDict, total=False): + config: Required[AccessOktaConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOktaScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOktaConfig(TypedDict, total=False): + authorization_server_id: str + """Your okta authorization server id""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + okta_account: str + """Your okta account url""" + + +class AccessOktaScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOnelogin(TypedDict, total=False): + config: Required[AccessOneloginConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOneloginScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOneloginConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + onelogin_account: str + """Your OneLogin account url""" + + +class AccessOneloginScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessPingone(TypedDict, total=False): + config: Required[AccessPingoneConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessPingoneScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessPingoneConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + ping_env_id: str + """Your PingOne environment identifier""" + + +class AccessPingoneScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessSaml(TypedDict, total=False): + config: Required[AccessSamlConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessSamlScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessSamlConfigHeaderAttribute(TypedDict, total=False): + attribute_name: str + """attribute name from the IDP""" + + header_name: str + """header that will be added on the request to the origin""" + + +class AccessSamlConfig(TypedDict, total=False): + attributes: List[str] + """ + A list of SAML attribute names that will be added to your signed JWT token and + can be used in SAML policy rules. + """ + + email_attribute_name: str + """The attribute name for email in the SAML response.""" + + header_attributes: Iterable[AccessSamlConfigHeaderAttribute] + """ + Add a list of attribute names that will be returned in the response header from + the Access callback. + """ + + idp_public_certs: List[str] + """X509 certificate to verify the signature in the SAML authentication response""" + + issuer_url: str + """IdP Entity ID or Issuer URL""" + + sign_request: bool + """Sign the SAML authentication request with Access credentials. + + To verify the signature, use the public key from the Access certs endpoints. + """ + + sso_target_url: str + """URL to send the SAML authentication requests to""" + + +class AccessSamlScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessYandex(TypedDict, total=False): + config: Required[AccessYandexConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessYandexScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessYandexConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessYandexScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOnetimepin(TypedDict, total=False): + config: Required[object] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOnetimepinScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOnetimepinScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +IdentityProviderCreateParams = Union[ + AccessAzureAd, + AccessCentrify, + AccessFacebook, + AccessGitHub, + AccessGoogle, + AccessGoogleApps, + AccessLinkedin, + AccessOidc, + AccessOkta, + AccessOnelogin, + AccessPingone, + AccessSaml, + AccessYandex, + AccessOnetimepin, +] diff --git a/src/cloudflare/types/zero_trust/identity_provider_update_params.py b/src/cloudflare/types/zero_trust/identity_provider_update_params.py index 079b56fa619..27b9ae810b7 100644 --- a/src/cloudflare/types/zero_trust/identity_provider_update_params.py +++ b/src/cloudflare/types/zero_trust/identity_provider_update_params.py @@ -2,14 +2,63 @@ from __future__ import annotations -from typing import List, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, Required, TypedDict -__all__ = ["IdentityProviderUpdateParams", "Config", "ConfigHeaderAttribute", "ScimConfig"] +__all__ = [ + "IdentityProviderUpdateParams", + "AccessAzureAd", + "AccessAzureAdConfig", + "AccessAzureAdScimConfig", + "AccessCentrify", + "AccessCentrifyConfig", + "AccessCentrifyScimConfig", + "AccessFacebook", + "AccessFacebookConfig", + "AccessFacebookScimConfig", + "AccessGitHub", + "AccessGitHubConfig", + "AccessGitHubScimConfig", + "AccessGoogle", + "AccessGoogleConfig", + "AccessGoogleScimConfig", + "AccessGoogleApps", + "AccessGoogleAppsConfig", + "AccessGoogleAppsScimConfig", + "AccessLinkedin", + "AccessLinkedinConfig", + "AccessLinkedinScimConfig", + "AccessOidc", + "AccessOidcConfig", + "AccessOidcScimConfig", + "AccessOkta", + "AccessOktaConfig", + "AccessOktaScimConfig", + "AccessOnelogin", + "AccessOneloginConfig", + "AccessOneloginScimConfig", + "AccessPingone", + "AccessPingoneConfig", + "AccessPingoneScimConfig", + "AccessSaml", + "AccessSamlConfig", + "AccessSamlConfigHeaderAttribute", + "AccessSamlScimConfig", + "AccessYandex", + "AccessYandexConfig", + "AccessYandexScimConfig", + "AccessOnetimepin", + "AccessOnetimepinScimConfig", +] -class IdentityProviderUpdateParams(TypedDict, total=False): - config: Required[Config] +class AccessAzureAd(TypedDict, total=False): + config: Required[AccessAzureAdConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ name: Required[str] """The name of the identity provider, shown to users on the login page.""" @@ -44,42 +93,136 @@ class IdentityProviderUpdateParams(TypedDict, total=False): zone_id: str """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - scim_config: ScimConfig + scim_config: AccessAzureAdScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ -class ConfigHeaderAttribute(TypedDict, total=False): - attribute_name: str - """attribute name from the IDP""" +class AccessAzureAdConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" - header_name: str - """header that will be added on the request to the origin""" + client_id: str + """Your OAuth Client ID""" + client_secret: str + """Your OAuth Client Secret""" -class Config(TypedDict, total=False): - apps_domain: str - """Your companies TLD""" + conditional_access_enabled: bool + """Should Cloudflare try to load authentication contexts from your account""" - attributes: List[str] + directory_id: str + """Your Azure directory uuid""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + prompt: Literal["login", "select_account", "none"] + """Indicates the type of user interaction that is required. + + prompt=login forces the user to enter their credentials on that request, + negating single-sign on. prompt=none is the opposite. It ensures that the user + isn't presented with any interactive prompt. If the request can't be completed + silently by using single-sign on, the Microsoft identity platform returns an + interaction_required error. prompt=select_account interrupts single sign-on + providing account selection experience listing all the accounts either in + session or any remembered account or an option to choose to use a different + account altogether. """ - A list of SAML attribute names that will be added to your signed JWT token and - can be used in SAML policy rules. + + support_groups: bool + """Should Cloudflare try to load groups from your account""" + + +class AccessAzureAdScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. """ - auth_url: str - """The authorization_endpoint URL of your IdP""" + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ - authorization_server_id: str - """Your okta authorization server id""" + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessCentrify(TypedDict, total=False): + config: Required[AccessCentrifyConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + scim_config: AccessCentrifyScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessCentrifyConfig(TypedDict, total=False): centrify_account: str """Your centrify account url""" centrify_app_id: str """Your centrify app id""" - certs_url: str - """The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens""" - claims: List[str] """Custom claims""" @@ -89,72 +232,99 @@ class Config(TypedDict, total=False): client_secret: str """Your OAuth Client Secret""" - conditional_access_enabled: bool - """Should Cloudflare try to load authentication contexts from your account""" + email_claim_name: str + """The claim name for email in the id_token response.""" - directory_id: str - """Your Azure directory uuid""" - email_attribute_name: str - """The attribute name for email in the SAML response.""" +class AccessCentrifyScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" - email_claim_name: str - """The claim name for email in the id_token response.""" + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ - header_attributes: Iterable[ConfigHeaderAttribute] + seat_deprovision: bool """ - Add a list of attribute names that will be returned in the response header from - the Access callback. + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. """ - idp_public_certs: List[str] - """X509 certificate to verify the signature in the SAML authentication response""" + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ - issuer_url: str - """IdP Entity ID or Issuer URL""" + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ - okta_account: str - """Your okta account url""" - onelogin_account: str - """Your OneLogin account url""" +class AccessFacebook(TypedDict, total=False): + config: Required[AccessFacebookConfig] + """The configuration parameters for the identity provider. - ping_env_id: str - """Your PingOne environment identifier""" + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ - prompt: Literal["login", "select_account", "none"] - """Indicates the type of user interaction that is required. + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" - prompt=login forces the user to enter their credentials on that request, - negating single-sign on. prompt=none is the opposite. It ensures that the user - isn't presented with any interactive prompt. If the request can't be completed - silently by using single-sign on, the Microsoft identity platform returns an - interaction_required error. prompt=select_account interrupts single sign-on - providing account selection experience listing all the accounts either in - session or any remembered account or an option to choose to use a different - account altogether. + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). """ - scopes: List[str] - """OAuth scopes""" + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" - sign_request: bool - """Sign the SAML authentication request with Access credentials. + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" - To verify the signature, use the public key from the Access certs endpoints. + scim_config: AccessFacebookScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. """ - sso_target_url: str - """URL to send the SAML authentication requests to""" - support_groups: bool - """Should Cloudflare try to load groups from your account""" +class AccessFacebookConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" - token_url: str - """The token_endpoint URL of your IdP""" + client_secret: str + """Your OAuth Client Secret""" -class ScimConfig(TypedDict, total=False): +class AccessFacebookScimConfig(TypedDict, total=False): enabled: bool """A flag to enable or disable SCIM for the identity provider.""" @@ -184,3 +354,1076 @@ class ScimConfig(TypedDict, total=False): A flag to enable revoking a user's session in Access and Gateway when they have been deprovisioned in the Identity Provider. """ + + +class AccessGitHub(TypedDict, total=False): + config: Required[AccessGitHubConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGitHubScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGitHubConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessGitHubScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessGoogle(TypedDict, total=False): + config: Required[AccessGoogleConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGoogleScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGoogleConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + +class AccessGoogleScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessGoogleApps(TypedDict, total=False): + config: Required[AccessGoogleAppsConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessGoogleAppsScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessGoogleAppsConfig(TypedDict, total=False): + apps_domain: str + """Your companies TLD""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + +class AccessGoogleAppsScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessLinkedin(TypedDict, total=False): + config: Required[AccessLinkedinConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessLinkedinScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessLinkedinConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessLinkedinScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOidc(TypedDict, total=False): + config: Required[AccessOidcConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOidcScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOidcConfig(TypedDict, total=False): + auth_url: str + """The authorization_endpoint URL of your IdP""" + + certs_url: str + """The jwks_uri endpoint of your IdP to allow the IdP keys to sign the tokens""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + scopes: List[str] + """OAuth scopes""" + + token_url: str + """The token_endpoint URL of your IdP""" + + +class AccessOidcScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOkta(TypedDict, total=False): + config: Required[AccessOktaConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOktaScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOktaConfig(TypedDict, total=False): + authorization_server_id: str + """Your okta authorization server id""" + + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + okta_account: str + """Your okta account url""" + + +class AccessOktaScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOnelogin(TypedDict, total=False): + config: Required[AccessOneloginConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOneloginScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOneloginConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + onelogin_account: str + """Your OneLogin account url""" + + +class AccessOneloginScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessPingone(TypedDict, total=False): + config: Required[AccessPingoneConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessPingoneScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessPingoneConfig(TypedDict, total=False): + claims: List[str] + """Custom claims""" + + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + email_claim_name: str + """The claim name for email in the id_token response.""" + + ping_env_id: str + """Your PingOne environment identifier""" + + +class AccessPingoneScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessSaml(TypedDict, total=False): + config: Required[AccessSamlConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessSamlScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessSamlConfigHeaderAttribute(TypedDict, total=False): + attribute_name: str + """attribute name from the IDP""" + + header_name: str + """header that will be added on the request to the origin""" + + +class AccessSamlConfig(TypedDict, total=False): + attributes: List[str] + """ + A list of SAML attribute names that will be added to your signed JWT token and + can be used in SAML policy rules. + """ + + email_attribute_name: str + """The attribute name for email in the SAML response.""" + + header_attributes: Iterable[AccessSamlConfigHeaderAttribute] + """ + Add a list of attribute names that will be returned in the response header from + the Access callback. + """ + + idp_public_certs: List[str] + """X509 certificate to verify the signature in the SAML authentication response""" + + issuer_url: str + """IdP Entity ID or Issuer URL""" + + sign_request: bool + """Sign the SAML authentication request with Access credentials. + + To verify the signature, use the public key from the Access certs endpoints. + """ + + sso_target_url: str + """URL to send the SAML authentication requests to""" + + +class AccessSamlScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessYandex(TypedDict, total=False): + config: Required[AccessYandexConfig] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessYandexScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessYandexConfig(TypedDict, total=False): + client_id: str + """Your OAuth Client ID""" + + client_secret: str + """Your OAuth Client Secret""" + + +class AccessYandexScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +class AccessOnetimepin(TypedDict, total=False): + config: Required[object] + """The configuration parameters for the identity provider. + + To view the required parameters for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + name: Required[str] + """The name of the identity provider, shown to users on the login page.""" + + type: Required[ + Literal[ + "onetimepin", + "azureAD", + "saml", + "centrify", + "facebook", + "github", + "google-apps", + "google", + "linkedin", + "oidc", + "okta", + "onelogin", + "pingone", + "yandex", + ] + ] + """The type of identity provider. + + To determine the value for a specific provider, refer to our + [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/). + """ + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + scim_config: AccessOnetimepinScimConfig + """ + The configuration settings for enabling a System for Cross-Domain Identity + Management (SCIM) with the identity provider. + """ + + +class AccessOnetimepinScimConfig(TypedDict, total=False): + enabled: bool + """A flag to enable or disable SCIM for the identity provider.""" + + group_member_deprovision: bool + """ + A flag to revoke a user's session in Access and force a reauthentication on the + user's Gateway session when they have been added or removed from a group in the + Identity Provider. + """ + + seat_deprovision: bool + """ + A flag to remove a user's seat in Zero Trust when they have been deprovisioned + in the Identity Provider. This cannot be enabled unless user_deprovision is also + enabled. + """ + + secret: str + """ + A read-only token generated when the SCIM integration is enabled for the first + time. It is redacted on subsequent requests. If you lose this you will need to + refresh it token at /access/identity_providers/:idpID/refresh_scim_secret. + """ + + user_deprovision: bool + """ + A flag to enable revoking a user's session in Access and Gateway when they have + been deprovisioned in the Identity Provider. + """ + + +IdentityProviderUpdateParams = Union[ + AccessAzureAd, + AccessCentrify, + AccessFacebook, + AccessGitHub, + AccessGoogle, + AccessGoogleApps, + AccessLinkedin, + AccessOidc, + AccessOkta, + AccessOnelogin, + AccessPingone, + AccessSaml, + AccessYandex, + AccessOnetimepin, +] diff --git a/tests/api_resources/dns/test_records.py b/tests/api_resources/dns/test_records.py index ef3765cea2e..3ef9bf993d8 100644 --- a/tests/api_resources/dns/test_records.py +++ b/tests/api_resources/dns/test_records.py @@ -25,69 +25,24 @@ class TestRecords: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", name="example.com", - type="URI", + type="A", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", name="example.com", - type="URI", + type="A", comment="Domain verification record", - content={}, - data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", - "digest": "string", - "digest_type": 1, - "priority": 1, - "target": ".", - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, - "order": 100, - "preference": 10, - "regex": "string", - "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, - "fingerprint": "string", - "content": "http://example.com/example.html", - }, - meta={ - "auto_added": True, - "source": "primary", - }, - priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -96,11 +51,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", name="example.com", - type="URI", + type="A", ) assert response.is_closed is True @@ -110,11 +66,12 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", name="example.com", - type="URI", + type="A", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,81 +83,35 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.dns.records.with_raw_response.create( zone_id="", + content="198.51.100.4", name="example.com", - type="URI", + type="A", ) @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: - record = client.dns.records.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", name="example.com", - type="URI", + type="AAAA", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - record = client.dns.records.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", name="example.com", - type="URI", + type="AAAA", comment="Domain verification record", - content={}, - data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", - "digest": "string", - "digest_type": 1, - "priority": 1, - "target": ".", - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, - "order": 100, - "preference": 10, - "regex": "string", - "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, - "fingerprint": "string", - "content": "http://example.com/example.html", - }, - meta={ - "auto_added": True, - "source": "primary", - }, - priority=10, proxied=False, tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, @@ -209,12 +120,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", name="example.com", - type="URI", + type="AAAA", ) assert response.is_closed is True @@ -224,12 +135,12 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", name="example.com", - type="URI", + type="AAAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,187 +152,9103 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + client.dns.records.with_raw_response.create( zone_id="", + content="2400:cb00:2049::1", name="example.com", - type="URI", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - client.dns.records.with_raw_response.update( - "", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example.com", - type="URI", + type="AAAA", ) @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - record = client.dns.records.list( + def test_method_create_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", ) - assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - record = client.dns.records.list( + def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment={ - "present": "string", - "absent": "string", - "exact": "Hello, world", - "contains": "ello, worl", - "startswith": "Hello, w", - "endswith": "o, world", + data={ + "flags": 1, + "tag": "issue", + "value": "string", }, - content="127.0.0.1", - direction="asc", - match="any", name="example.com", - order="type", - page=1, - per_page=5, - proxied=False, - search="www.cloudflare.com", - tag={ - "present": "important", - "absent": "important", - "exact": "greeting:Hello, world", - "contains": "greeting:ello, worl", - "startswith": "greeting:Hello, w", - "endswith": "greeting:o, world", - }, - tag_match="any", - type="A", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, ) - assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.list( + def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.list( + def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_create_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.list( + client.dns.records.with_raw_response.create( zone_id="", + data={}, + name="example.com", + type="CAA", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - record = client.dns.records.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", ) - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = response.parse() - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + client.dns.records.with_raw_response.create( zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - client.dns.records.with_raw_response.delete( - "", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", ) @pytest.mark.skip() @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - record = client.dns.records.edit( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, name="example.com", - type="URI", + type="CNAME", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - record = client.dns.records.edit( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, name="example.com", - type="URI", + type="CNAME", comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", content={}, - data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, + "digest": "string", + "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", + "order": 100, + "preference": 10, + "regex": "string", + "replacement": "string", + "service": "string", + }, + name="example.com", + type="NAPTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="NAPTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + content="example.com", + name="example.com", + type="PTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SMIMEA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_15(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_15(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_15(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, + "fingerprint": "string", + "type": 1, + }, + name="example.com", + type="SSHFP", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SSHFP", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="SVCB", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_17(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SVCB", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, + name="example.com", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_18(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_19(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_19(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + content="example text content", + name="example.com", + type="TXT", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "content": "http://example.com/example.html", + "weight": 20, + }, + name="example.com", + priority=10, + type="URI", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_20(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_20(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_1(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="198.51.100.4", + name="example.com", + type="A", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": 1, + "tag": "issue", + "value": "string", + }, + name="example.com", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CERT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, + "digest": "string", + "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", + "order": 100, + "preference": 10, + "regex": "string", + "replacement": "string", + "service": "string", + }, + name="example.com", + type="NAPTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="NAPTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example.com", + name="example.com", + type="PTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SMIMEA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_15(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_15(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_15(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, + "fingerprint": "string", + "type": 1, + }, + name="example.com", + type="SSHFP", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_16(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_16(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SSHFP", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="SVCB", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_17(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_17(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_17(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SVCB", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, + name="example.com", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_18(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_18(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_18(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_19(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_19(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_19(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example text content", + name="example.com", + type="TXT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "content": "http://example.com/example.html", + "weight": 20, + }, + name="example.com", + priority=10, + type="URI", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_20(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_20(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_20(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + record = client.dns.records.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + record = client.dns.records.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + comment={ + "present": "string", + "absent": "string", + "exact": "Hello, world", + "contains": "ello, worl", + "startswith": "Hello, w", + "endswith": "o, world", + }, + content="127.0.0.1", + direction="asc", + match="any", + name="example.com", + order="type", + page=1, + per_page=5, + proxied=False, + search="www.cloudflare.com", + tag={ + "present": "important", + "absent": "important", + "exact": "greeting:Hello, world", + "contains": "greeting:ello, worl", + "startswith": "greeting:Hello, w", + "endswith": "greeting:o, world", + }, + tag_match="any", + type="A", + ) + assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(SyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.list( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + record = client.dns.records.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.delete( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_1(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="198.51.100.4", + name="example.com", + type="A", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": 1, + "tag": "issue", + "value": "string", + }, + name="example.com", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CERT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_5(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_6(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_7(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, + "digest": "string", + "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_8(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_9(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_10(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_11(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", + "order": 100, + "preference": 10, + "regex": "string", + "replacement": "string", + "service": "string", + }, + name="example.com", + type="NAPTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="NAPTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_12(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_13(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example.com", + name="example.com", + type="PTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_14(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SMIMEA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_15(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_15(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, + "fingerprint": "string", + "type": 1, + }, + name="example.com", + type="SSHFP", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SSHFP", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="SVCB", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SVCB", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, + name="example.com", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example text content", + name="example.com", + type="TXT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> None: + record = client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "content": "http://example.com/example.html", + "weight": 20, + }, + name="example.com", + priority=10, + type="URI", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + @pytest.mark.skip() + @parametrize + def test_method_export(self, client: Cloudflare) -> None: + record = client.dns.records.export( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(str, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_export(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.export( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(str, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_export(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.export( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(str, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_export(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.export( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + record = client.dns.records.get( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + client.dns.records.with_raw_response.get( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_import(self, client: Cloudflare) -> None: + record = client.dns.records.import_( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + file="www.example.com. 300 IN A 127.0.0.1", + ) + assert_matches_type(RecordImportResponse, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_import_with_all_params(self, client: Cloudflare) -> None: + record = client.dns.records.import_( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + file="www.example.com. 300 IN A 127.0.0.1", + proxied="true", + ) + assert_matches_type(RecordImportResponse, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_import(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.import_( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + file="www.example.com. 300 IN A 127.0.0.1", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(RecordImportResponse, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_import(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.import_( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + file="www.example.com. 300 IN A 127.0.0.1", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(RecordImportResponse, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_import(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.import_( + zone_id="", + file="www.example.com. 300 IN A 127.0.0.1", + ) + + @pytest.mark.skip() + @parametrize + def test_method_scan(self, client: Cloudflare) -> None: + record = client.dns.records.scan( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(RecordScanResponse, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_scan(self, client: Cloudflare) -> None: + response = client.dns.records.with_raw_response.scan( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = response.parse() + assert_matches_type(RecordScanResponse, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_scan(self, client: Cloudflare) -> None: + with client.dns.records.with_streaming_response.scan( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = response.parse() + assert_matches_type(RecordScanResponse, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_scan(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.dns.records.with_raw_response.scan( + zone_id="", + ) + + +class TestAsyncRecords: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="198.51.100.4", + name="example.com", + type="A", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": 1, + "tag": "issue", + "value": "string", + }, + name="example.com", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="CAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="CERT", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, + "digest": "string", + "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", + "order": 100, + "preference": 10, + "regex": "string", + "replacement": "string", + "service": "string", + }, + name="example.com", + type="NAPTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="NAPTR", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="example.com", + name="example.com", + type="PTR", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_14(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SMIMEA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_15(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_15(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_15(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, + "fingerprint": "string", + "type": 1, + }, + name="example.com", + type="SSHFP", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_16(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SSHFP", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="SVCB", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_17(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="SVCB", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, + name="example.com", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_18(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_19(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + content="example text content", + name="example.com", + type="TXT", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "content": "http://example.com/example.html", + "weight": 20, + }, + name="example.com", + priority=10, + type="URI", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_20(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.create( + zone_id="", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="198.51.100.4", + name="example.com", + type="A", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": 1, + "tag": "issue", + "value": "string", + }, + name="example.com", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CERT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, + "digest": "string", + "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "altitude": 0, + "lat_degrees": 37, + "lat_direction": "N", + "lat_minutes": 46, + "lat_seconds": 46, + "long_degrees": 122, + "long_direction": "W", + "long_minutes": 23, + "long_seconds": 35, + "precision_horz": 0, + "precision_vert": 0, + "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", + "order": 100, + "preference": 10, + "regex": "string", + "replacement": "string", + "service": "string", + }, + name="example.com", + type="NAPTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="NAPTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_12(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_13(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example.com", + name="example.com", + type="PTR", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_14(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_14(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_14(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SMIMEA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_15(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_15(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_15(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, + "fingerprint": "string", + "type": 1, + }, + name="example.com", + type="SSHFP", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_16(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_16(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_16(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SSHFP", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "priority": 1, + "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="SVCB", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_17(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_17(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_17(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="SVCB", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SVCB", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, + }, + name="example.com", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_18(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_18(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_18(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_19(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_19(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_19(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="example text content", + name="example.com", + type="TXT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_20(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "content": "http://example.com/example.html", + "weight": 20, + }, + name="example.com", + priority=10, + type="URI", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_20(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_20(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_20(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.update( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + priority=10, + type="URI", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + comment={ + "present": "string", + "absent": "string", + "exact": "Hello, world", + "contains": "ello, worl", + "startswith": "Hello, w", + "endswith": "o, world", + }, + content="127.0.0.1", + direction="asc", + match="any", + name="example.com", + order="type", + page=1, + per_page=5, + proxied=False, + search="www.cloudflare.com", + tag={ + "present": "important", + "absent": "important", + "exact": "greeting:Hello, world", + "contains": "greeting:ello, worl", + "startswith": "greeting:Hello, w", + "endswith": "greeting:o, world", + }, + tag_match="any", + type="A", + ) + assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.list( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.delete( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="198.51.100.4", + name="example.com", + type="A", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="198.51.100.4", + name="example.com", + type="A", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="2400:cb00:2049::1", + name="example.com", + type="AAAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": 1, + "tag": "issue", + "value": "string", + }, + name="example.com", + type="CAA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CAA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CAA", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 8, + "certificate": "string", + "key_tag": 1, + "type": 9, + }, + name="example.com", + type="CERT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="CERT", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="CERT", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + comment="Domain verification record", + proxied=False, + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content={}, + name="example.com", + type="CNAME", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content={}, + name="example.com", + type="CNAME", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 5, + "flags": 1, + "protocol": 3, + "public_key": "string", + }, + name="example.com", + type="DNSKEY", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DNSKEY", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DNSKEY", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 3, "digest": "string", "digest_type": 1, + "key_tag": 1, + }, + name="example.com", + type="DS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="DS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="DS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ "priority": 1, "target": ".", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', + }, + name="example.com", + type="HTTPS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="HTTPS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="HTTPS", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ "altitude": 0, "lat_degrees": 37, "lat_direction": "N", @@ -434,27 +9261,187 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "precision_horz": 0, "precision_vert": 0, "size": 100, + }, + name="example.com", + type="LOC", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + data={}, + name="example.com", + type="LOC", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="LOC", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="mx.example.com", + name="example.com", + priority=10, + type="MX", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="NAPTR", + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "flags": "string", "order": 100, "preference": 10, "regex": "string", "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, - "fingerprint": "string", - "content": "http://example.com/example.html", - }, - meta={ - "auto_added": True, - "source": "primary", + "service": "string", }, - priority=10, - proxied=False, + name="example.com", + type="NAPTR", + comment="Domain verification record", tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, ) @@ -462,317 +9449,426 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.edit( + async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="NAPTR", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() + record = await response.parse() assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.edit( + async def test_streaming_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="NAPTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() + record = await response.parse() assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.edit( + await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, name="example.com", - type="URI", + type="NAPTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - client.dns.records.with_raw_response.edit( + await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="NAPTR", ) @pytest.mark.skip() @parametrize - def test_method_export(self, client: Cloudflare) -> None: - record = client.dns.records.export( + async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", ) - assert_matches_type(str, record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_export(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.export( + async def test_method_edit_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(str, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_export(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.export( + async def test_streaming_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(str, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_export(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.export( + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + content="ns1.example.com", + name="example.com", + type="NS", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="ns1.example.com", + name="example.com", + type="NS", ) @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - record = client.dns.records.get( + async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.get( + async def test_method_edit_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() + record = await response.parse() assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.get( + async def test_streaming_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() + record = await response.parse() assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.get( + await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + content="example.com", + name="example.com", + type="PTR", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - client.dns.records.with_raw_response.get( + await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example.com", + name="example.com", + type="PTR", ) @pytest.mark.skip() @parametrize - def test_method_import(self, client: Cloudflare) -> None: - record = client.dns.records.import_( + async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - file="www.example.com. 300 IN A 127.0.0.1", + data={}, + name="example.com", + type="SMIMEA", ) - assert_matches_type(RecordImportResponse, record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_import_with_all_params(self, client: Cloudflare) -> None: - record = client.dns.records.import_( + async def test_method_edit_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - file="www.example.com. 300 IN A 127.0.0.1", - proxied="true", + data={ + "certificate": "string", + "matching_type": 0, + "selector": 0, + "usage": 3, + }, + name="example.com", + type="SMIMEA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, ) - assert_matches_type(RecordImportResponse, record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_import(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.import_( + async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - file="www.example.com. 300 IN A 127.0.0.1", + data={}, + name="example.com", + type="SMIMEA", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(RecordImportResponse, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_import(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.import_( + async def test_streaming_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - file="www.example.com. 300 IN A 127.0.0.1", + data={}, + name="example.com", + type="SMIMEA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(RecordImportResponse, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_import(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.import_( + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - file="www.example.com. 300 IN A 127.0.0.1", + data={}, + name="example.com", + type="SMIMEA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SMIMEA", ) @pytest.mark.skip() @parametrize - def test_method_scan(self, client: Cloudflare) -> None: - record = client.dns.records.scan( + async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", ) - assert_matches_type(RecordScanResponse, record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_scan(self, client: Cloudflare) -> None: - response = client.dns.records.with_raw_response.scan( + async def test_method_edit_with_all_params_overload_15(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "name": "example.com", + "port": 8806, + "priority": 10, + "proto": "_tcp", + "service": "_sip", + "target": "example.com", + "weight": 5, + }, + name="_sip._tcp.example.com", + type="SRV", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(RecordScanResponse, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_scan(self, client: Cloudflare) -> None: - with client.dns.records.with_streaming_response.scan( + async def test_streaming_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - record = response.parse() - assert_matches_type(RecordScanResponse, record, path=["response"]) + record = await response.parse() + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_scan(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.dns.records.with_raw_response.scan( + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, + name="_sip._tcp.example.com", + type="SRV", ) - -class TestAsyncRecords: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="_sip._tcp.example.com", + type="SRV", + ) @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.create( + async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SSHFP", ) assert_matches_type(DNSRecord, record, path=["response"]) - - @pytest.mark.skip() - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.create( - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example.com", - type="URI", - comment="Domain verification record", - content={}, - data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", - "digest": "string", - "digest_type": 1, - "priority": 1, - "target": ".", - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, - "order": 100, - "preference": 10, - "regex": "string", - "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, + + @pytest.mark.skip() + @parametrize + async def test_method_edit_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={ + "algorithm": 2, "fingerprint": "string", - "content": "http://example.com/example.html", - }, - meta={ - "auto_added": True, - "source": "primary", + "type": 1, }, - priority=10, - proxied=False, + name="example.com", + type="SSHFP", + comment="Domain verification record", tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, ) @@ -780,11 +9876,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.records.with_raw_response.create( + async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SSHFP", ) assert response.is_closed is True @@ -794,11 +9892,13 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.records.with_streaming_response.create( + async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SSHFP", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -810,82 +9910,51 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.dns.records.with_raw_response.create( + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, name="example.com", - type="URI", + type="SSHFP", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="SSHFP", ) @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.update( + async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SVCB", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.update( + async def test_method_edit_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example.com", - type="URI", - comment="Domain verification record", - content={}, data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", - "digest": "string", - "digest_type": 1, "priority": 1, "target": ".", - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, - "order": 100, - "preference": 10, - "regex": "string", - "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, - "fingerprint": "string", - "content": "http://example.com/example.html", - }, - meta={ - "auto_added": True, - "source": "primary", + "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', }, - priority=10, - proxied=False, + name="example.com", + type="SVCB", + comment="Domain verification record", tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, ) @@ -893,12 +9962,13 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.records.with_raw_response.update( + async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SVCB", ) assert response.is_closed is True @@ -908,12 +9978,13 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.records.with_streaming_response.update( + async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SVCB", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -925,220 +9996,221 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.dns.records.with_raw_response.update( + await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, name="example.com", - type="URI", + type="SVCB", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - await async_client.dns.records.with_raw_response.update( + await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", - type="URI", + type="SVCB", ) @pytest.mark.skip() @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.list( + async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", ) - assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.list( + async def test_method_edit_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - comment={ - "present": "string", - "absent": "string", - "exact": "Hello, world", - "contains": "ello, worl", - "startswith": "Hello, w", - "endswith": "o, world", + data={ + "certificate": "string", + "matching_type": 1, + "selector": 0, + "usage": 0, }, - content="127.0.0.1", - direction="asc", - match="any", name="example.com", - order="type", - page=1, - per_page=5, - proxied=False, - search="www.cloudflare.com", - tag={ - "present": "important", - "absent": "important", - "exact": "greeting:Hello, world", - "contains": "greeting:ello, worl", - "startswith": "greeting:Hello, w", - "endswith": "greeting:o, world", - }, - tag_match="any", - type="A", + type="TLSA", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, ) - assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.records.with_raw_response.list( + async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.records.with_streaming_response.list( + async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[DNSRecord], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.dns.records.with_raw_response.list( + await async_client.dns.records.with_raw_response.edit( + "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, + name="example.com", + type="TLSA", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): + await async_client.dns.records.with_raw_response.edit( + "", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, + name="example.com", + type="TLSA", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - record = await async_client.dns.records.delete( + async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", ) - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.dns.records.with_raw_response.delete( + async def test_method_edit_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: + record = await async_client.dns.records.edit( + "023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", + comment="Domain verification record", + tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], + ttl=3600, + ) + assert_matches_type(DNSRecord, record, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.dns.records.with_streaming_response.delete( + async def test_streaming_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" record = await response.parse() - assert_matches_type(Optional[RecordDeleteResponse], record, path=["response"]) + assert_matches_type(DNSRecord, record, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.dns.records.with_raw_response.delete( + await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + content="example text content", + name="example.com", + type="TXT", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `dns_record_id` but received ''"): - await async_client.dns.records.with_raw_response.delete( + await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + content="example text content", + name="example.com", + type="TXT", ) @pytest.mark.skip() @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", + priority=10, type="URI", ) assert_matches_type(DNSRecord, record, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: record = await async_client.dns.records.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - name="example.com", - type="URI", - comment="Domain verification record", - content={}, data={ - "flags": {}, - "tag": "issue", - "value": 'alpn="h3,h2" ipv4hint="127.0.0.1" ipv6hint="::1"', - "algorithm": 2, - "certificate": "string", - "key_tag": 1, - "type": 1, - "protocol": 3, - "public_key": "string", - "digest": "string", - "digest_type": 1, - "priority": 1, - "target": ".", - "altitude": 0, - "lat_degrees": 37, - "lat_direction": "N", - "lat_minutes": 46, - "lat_seconds": 46, - "long_degrees": 122, - "long_direction": "W", - "long_minutes": 23, - "long_seconds": 35, - "precision_horz": 0, - "precision_vert": 0, - "size": 100, - "order": 100, - "preference": 10, - "regex": "string", - "replacement": "string", - "service": "_sip", - "matching_type": 1, - "selector": 0, - "usage": 0, - "name": "example.com", - "port": 8806, - "proto": "_tcp", - "weight": 20, - "fingerprint": "string", "content": "http://example.com/example.html", + "weight": 20, }, - meta={ - "auto_added": True, - "source": "primary", - }, + name="example.com", priority=10, - proxied=False, + type="URI", + comment="Domain verification record", tags=["owner:dns-team", "owner:dns-team", "owner:dns-team"], ttl=3600, ) @@ -1146,11 +10218,13 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) @pytest.mark.skip() @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", + priority=10, type="URI", ) @@ -1161,11 +10235,13 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.records.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", + priority=10, type="URI", ) as response: assert not response.is_closed @@ -1178,12 +10254,14 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip() @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.dns.records.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", zone_id="", + data={}, name="example.com", + priority=10, type="URI", ) @@ -1191,7 +10269,9 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.dns.records.with_raw_response.edit( "", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + data={}, name="example.com", + priority=10, type="URI", ) diff --git a/tests/api_resources/images/test_v1.py b/tests/api_resources/images/test_v1.py index 872430d7229..c46f71ba3f1 100644 --- a/tests/api_resources/images/test_v1.py +++ b/tests/api_resources/images/test_v1.py @@ -24,27 +24,65 @@ class TestV1: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: v1 = client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, ) assert_matches_type(ImagesImage, v1, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + response = client.images.v1.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v1 = response.parse() + assert_matches_type(ImagesImage, v1, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + with client.images.v1.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v1 = response.parse() + assert_matches_type(ImagesImage, v1, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.images.v1.with_raw_response.create( + account_id="", + file={}, + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: v1 = client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, - require_signed_urls=True, + url="https://example.com/path/to/logo.png", ) assert_matches_type(ImagesImage, v1, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.images.v1.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + url="https://example.com/path/to/logo.png", ) assert response.is_closed is True @@ -54,9 +92,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.images.v1.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + url="https://example.com/path/to/logo.png", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -68,10 +107,11 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.images.v1.with_raw_response.create( account_id="", + url="https://example.com/path/to/logo.png", ) @pytest.mark.skip() @@ -299,27 +339,65 @@ class TestAsyncV1: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: v1 = await async_client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, ) assert_matches_type(ImagesImage, v1, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.images.v1.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + v1 = await response.parse() + assert_matches_type(ImagesImage, v1, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.images.v1.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + file={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + v1 = await response.parse() + assert_matches_type(ImagesImage, v1, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.images.v1.with_raw_response.create( + account_id="", + file={}, + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: v1 = await async_client.images.v1.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", - metadata={}, - require_signed_urls=True, + url="https://example.com/path/to/logo.png", ) assert_matches_type(ImagesImage, v1, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.images.v1.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + url="https://example.com/path/to/logo.png", ) assert response.is_closed is True @@ -329,9 +407,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.images.v1.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + url="https://example.com/path/to/logo.png", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -343,10 +422,11 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_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.images.v1.with_raw_response.create( account_id="", + url="https://example.com/path/to/logo.png", ) @pytest.mark.skip() diff --git a/tests/api_resources/r2/test_sippy.py b/tests/api_resources/r2/test_sippy.py index c32eb4a3df9..c4b84c6282f 100644 --- a/tests/api_resources/r2/test_sippy.py +++ b/tests/api_resources/r2/test_sippy.py @@ -19,7 +19,7 @@ class TestSippy: @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: sippy = client.r2.sippy.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: sippy = client.r2.sippy.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -40,18 +40,88 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: source={ "access_key_id": "string", "bucket": "string", - "provider": "gcs", + "provider": "aws", "region": "string", "secret_access_key": "string", + }, + ) + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.r2.sippy.with_raw_response.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sippy = response.parse() + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.r2.sippy.with_streaming_response.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sippy = response.parse() + assert_matches_type(R2Sippy, sippy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.r2.sippy.with_raw_response.update( + "example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + client.r2.sippy.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + sippy = client.r2.sippy.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + sippy = client.r2.sippy.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + destination={ + "access_key_id": "string", + "provider": "r2", + "secret_access_key": "string", + }, + source={ + "bucket": "string", "client_email": "string", "private_key": "string", + "provider": "gcs", }, ) assert_matches_type(R2Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.r2.sippy.with_raw_response.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -64,7 +134,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.r2.sippy.with_streaming_response.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -79,7 +149,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + 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.r2.sippy.with_raw_response.update( "example-bucket", @@ -202,7 +272,7 @@ class TestAsyncSippy: @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: sippy = await async_client.r2.sippy.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -211,7 +281,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: sippy = await async_client.r2.sippy.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -223,18 +293,88 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare source={ "access_key_id": "string", "bucket": "string", - "provider": "gcs", + "provider": "aws", "region": "string", "secret_access_key": "string", + }, + ) + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.r2.sippy.with_raw_response.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + sippy = await response.parse() + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.r2.sippy.with_streaming_response.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + sippy = await response.parse() + assert_matches_type(R2Sippy, sippy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.r2.sippy.with_raw_response.update( + "example-bucket", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `bucket_name` but received ''"): + await async_client.r2.sippy.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + sippy = await async_client.r2.sippy.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(R2Sippy, sippy, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + sippy = await async_client.r2.sippy.update( + "example-bucket", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + destination={ + "access_key_id": "string", + "provider": "r2", + "secret_access_key": "string", + }, + source={ + "bucket": "string", "client_email": "string", "private_key": "string", + "provider": "gcs", }, ) assert_matches_type(R2Sippy, sippy, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.r2.sippy.with_raw_response.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -247,7 +387,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.r2.sippy.with_streaming_response.update( "example-bucket", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -262,7 +402,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + 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.r2.sippy.with_raw_response.update( "example-bucket", diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index 1019e598f4b..51ec61ff352 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -19,7 +19,7 @@ class TestRules: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( "2f2feab2026849078ba485f918791bdc", account_id="string", @@ -29,18 +29,31 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( "2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", - position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + id="3a03d665bac047339bb530ecb439a90d", + action="block", + action_parameters={ + "response": { + "content": '{\n "success": false,\n "error": "you have been blocked"\n}', + "content_type": "application/json", + "status_code": 400, + } + }, + description="Block when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", ) assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.create( "2f2feab2026849078ba485f918791bdc", account_id="string", @@ -54,7 +67,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.create( "2f2feab2026849078ba485f918791bdc", account_id="string", @@ -70,7 +83,284 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="execute", + action_parameters={ + "id": "4814384a9e5d4991b9815dcfc25d2f1f", + "matched_data": {"public_key": "iGqBmyIUxuWt1rvxoAharN9FUXneUBxA/Y19PyyrEG0="}, + "overrides": { + "action": "log", + "categories": [ + { + "action": "log", + "category": "directory-traversal", + "enabled": True, + "sensitivity_level": "default", + } + ], + "enabled": True, + "rules": [ + { + "action": "log", + "enabled": True, + "id": "8ac8bc2a661e475d940980f9317f28e1", + "score_threshold": 0, + "sensitivity_level": "default", + } + ], + "sensitivity_level": "default", + }, + }, + description="Execute the OWASP ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_3(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="log", + action_parameters={}, + description="Log when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_4(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="skip", + action_parameters={ + "phases": ["http_request_firewall_custom"], + "products": ["bic"], + "rules": {"4814384a9e5d4991b9815dcfc25d2f1f": ["8ac8bc2a661e475d940980f9317f28e1"]}, + "ruleset": "current", + "rulesets": ["4814384a9e5d4991b9815dcfc25d2f1f"], + }, + description="Skip the current ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( "", @@ -105,8 +395,891 @@ def test_method_delete(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - rule = client.rulesets.rules.delete( + def test_method_delete_with_all_params(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.delete( + "", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_1(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="block", + action_parameters={ + "response": { + "content": '{\n "success": false,\n "error": "you have been blocked"\n}', + "content_type": "application/json", + "status_code": 400, + } + }, + description="Block when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_2(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="execute", + action_parameters={ + "id": "4814384a9e5d4991b9815dcfc25d2f1f", + "matched_data": {"public_key": "iGqBmyIUxuWt1rvxoAharN9FUXneUBxA/Y19PyyrEG0="}, + "overrides": { + "action": "log", + "categories": [ + { + "action": "log", + "category": "directory-traversal", + "enabled": True, + "sensitivity_level": "default", + } + ], + "enabled": True, + "rules": [ + { + "action": "log", + "enabled": True, + "id": "8ac8bc2a661e475d940980f9317f28e1", + "score_threshold": 0, + "sensitivity_level": "default", + } + ], + "sensitivity_level": "default", + }, + }, + description="Execute the OWASP ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_3(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_3(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="log", + action_parameters={}, + description="Log when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_edit_overload_4(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_edit_with_all_params_overload_4(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="skip", + action_parameters={ + "phases": ["http_request_firewall_custom"], + "products": ["bic"], + "rules": {"4814384a9e5d4991b9815dcfc25d2f1f": ["8ac8bc2a661e475d940980f9317f28e1"]}, + "ruleset": "current", + "rulesets": ["4814384a9e5d4991b9815dcfc25d2f1f"], + }, + description="Skip the current ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_edit_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + +class TestAsyncRules: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="block", + action_parameters={ + "response": { + "content": '{\n "success": false,\n "error": "you have been blocked"\n}', + "content_type": "application/json", + "status_code": 400, + } + }, + description="Block when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="execute", + action_parameters={ + "id": "4814384a9e5d4991b9815dcfc25d2f1f", + "matched_data": {"public_key": "iGqBmyIUxuWt1rvxoAharN9FUXneUBxA/Y19PyyrEG0="}, + "overrides": { + "action": "log", + "categories": [ + { + "action": "log", + "category": "directory-traversal", + "enabled": True, + "sensitivity_level": "default", + } + ], + "enabled": True, + "rules": [ + { + "action": "log", + "enabled": True, + "id": "8ac8bc2a661e475d940980f9317f28e1", + "score_threshold": 0, + "sensitivity_level": "default", + } + ], + "sensitivity_level": "default", + }, + }, + description="Execute the OWASP ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="log", + action_parameters={}, + description="Log when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_3(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="skip", + action_parameters={ + "phases": ["http_request_firewall_custom"], + "products": ["bic"], + "rules": {"4814384a9e5d4991b9815dcfc25d2f1f": ["8ac8bc2a661e475d940980f9317f28e1"]}, + "ruleset": "current", + "rulesets": ["4814384a9e5d4991b9815dcfc25d2f1f"], + }, + description="Skip the current ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + "2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.delete( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="string", + zone_id="string", + ) + assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -116,8 +1289,8 @@ def test_method_delete_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.rulesets.rules.with_raw_response.delete( + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -126,13 +1299,13 @@ 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" - rule = response.parse() + rule = await response.parse() assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.rulesets.rules.with_streaming_response.delete( + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -141,16 +1314,16 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() + rule = await response.parse() assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): - client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="string", @@ -158,7 +1331,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.delete( "", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -166,7 +1339,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", @@ -174,7 +1347,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.delete( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -183,8 +1356,8 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_edit(self, client: Cloudflare) -> None: - rule = client.rulesets.rules.edit( + async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -194,20 +1367,33 @@ def test_method_edit(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - rule = client.rulesets.rules.edit( + async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", - position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + id="3a03d665bac047339bb530ecb439a90d", + action="block", + action_parameters={ + "response": { + "content": '{\n "success": false,\n "error": "you have been blocked"\n}', + "content_type": "application/json", + "status_code": 400, + } + }, + description="Block when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", ) assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_edit(self, client: Cloudflare) -> None: - response = client.rulesets.rules.with_raw_response.edit( + async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -216,13 +1402,13 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() + rule = await response.parse() assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_edit(self, client: Cloudflare) -> None: - with client.rulesets.rules.with_streaming_response.edit( + async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -231,16 +1417,16 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - rule = response.parse() + rule = await response.parse() assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_edit(self, client: Cloudflare) -> None: + async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): - client.rulesets.rules.with_raw_response.edit( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="string", @@ -248,7 +1434,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - client.rulesets.rules.with_raw_response.edit( + await async_client.rulesets.rules.with_raw_response.edit( "", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -256,7 +1442,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.rulesets.rules.with_raw_response.edit( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", @@ -264,22 +1450,19 @@ def test_path_params_edit(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.rulesets.rules.with_raw_response.edit( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="", ) - -class TestAsyncRules: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.rulesets.rules.create( - "2f2feab2026849078ba485f918791bdc", + async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", ) @@ -287,20 +1470,54 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.rulesets.rules.create( - "2f2feab2026849078ba485f918791bdc", + async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", - position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + id="3a03d665bac047339bb530ecb439a90d", + action="execute", + action_parameters={ + "id": "4814384a9e5d4991b9815dcfc25d2f1f", + "matched_data": {"public_key": "iGqBmyIUxuWt1rvxoAharN9FUXneUBxA/Y19PyyrEG0="}, + "overrides": { + "action": "log", + "categories": [ + { + "action": "log", + "category": "directory-traversal", + "enabled": True, + "sensitivity_level": "default", + } + ], + "enabled": True, + "rules": [ + { + "action": "log", + "enabled": True, + "id": "8ac8bc2a661e475d940980f9317f28e1", + "score_threshold": 0, + "sensitivity_level": "default", + } + ], + "sensitivity_level": "default", + }, + }, + description="Execute the OWASP ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", ) assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.rulesets.rules.with_raw_response.create( - "2f2feab2026849078ba485f918791bdc", + async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", ) @@ -312,9 +1529,10 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.rulesets.rules.with_streaming_response.create( - "2f2feab2026849078ba485f918791bdc", + async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", ) as response: @@ -328,32 +1546,43 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.create( + await async_client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.edit( "", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.create( - "2f2feab2026849078ba485f918791bdc", + await async_client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.create( - "2f2feab2026849078ba485f918791bdc", + await async_client.rulesets.rules.with_raw_response.edit( + "3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.rulesets.rules.delete( + async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -363,19 +1592,27 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: - rule = await async_client.rulesets.rules.delete( + async def test_method_edit_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", + id="3a03d665bac047339bb530ecb439a90d", + action="log", + action_parameters={}, + description="Log when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", ) assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.rulesets.rules.with_raw_response.delete( + async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -389,8 +1626,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.rulesets.rules.with_streaming_response.delete( + async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -406,9 +1643,9 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="", account_id="string", @@ -416,7 +1653,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.edit( "", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -424,7 +1661,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="", @@ -432,7 +1669,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.rulesets.rules.with_raw_response.delete( + await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", @@ -441,7 +1678,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -452,19 +1689,32 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="string", zone_id="string", - position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + id="3a03d665bac047339bb530ecb439a90d", + action="skip", + action_parameters={ + "phases": ["http_request_firewall_custom"], + "products": ["bic"], + "rules": {"4814384a9e5d4991b9815dcfc25d2f1f": ["8ac8bc2a661e475d940980f9317f28e1"]}, + "ruleset": "current", + "rulesets": ["4814384a9e5d4991b9815dcfc25d2f1f"], + }, + description="Skip the current ruleset when the IP address is not 1.1.1.1", + enabled=True, + expression="ip.src ne 1.1.1.1", + logging={"enabled": True}, + ref="my_ref", ) assert_matches_type(RulesetsRulesetResponse, rule, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -479,7 +1729,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.edit( "3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -496,7 +1746,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip() @parametrize - async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( "3a03d665bac047339bb530ecb439a90d", diff --git a/tests/api_resources/test_bot_management.py b/tests/api_resources/test_bot_management.py index 9b30d74abd8..631f4206a83 100644 --- a/tests/api_resources/test_bot_management.py +++ b/tests/api_resources/test_bot_management.py @@ -19,7 +19,7 @@ class TestBotManagement: @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: bot_management = client.bot_management.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -27,24 +27,181 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: bot_management = client.bot_management.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - auto_update_model=True, enable_js=True, fight_mode=True, + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enable_js=True, + optimize_wordpress=True, + sbfm_definitely_automated="allow", + sbfm_static_resource_protection=True, + sbfm_verified_bots="allow", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_3(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enable_js=True, optimize_wordpress=True, sbfm_definitely_automated="allow", sbfm_likely_automated="allow", sbfm_static_resource_protection=True, sbfm_verified_bots="allow", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: + response = client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: + with client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_4(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: + bot_management = client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + auto_update_model=True, + enable_js=True, suppress_session_score=False, ) assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: response = client.bot_management.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -56,7 +213,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: with client.bot_management.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -70,7 +227,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + def test_path_params_update_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.bot_management.with_raw_response.update( zone_id="", @@ -124,7 +281,7 @@ class TestAsyncBotManagement: @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: bot_management = await async_client.bot_management.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -132,24 +289,181 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: bot_management = await async_client.bot_management.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - auto_update_model=True, enable_js=True, fight_mode=True, + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enable_js=True, + optimize_wordpress=True, + sbfm_definitely_automated="allow", + sbfm_static_resource_protection=True, + sbfm_verified_bots="allow", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enable_js=True, optimize_wordpress=True, sbfm_definitely_automated="allow", sbfm_likely_automated="allow", sbfm_static_resource_protection=True, sbfm_verified_bots="allow", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.bot_management.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.bot_management.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + bot_management = await response.parse() + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `zone_id` but received ''"): + await async_client.bot_management.with_raw_response.update( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + bot_management = await async_client.bot_management.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + auto_update_model=True, + enable_js=True, suppress_session_score=False, ) assert_matches_type(BotManagementUpdateResponse, bot_management, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: response = await async_client.bot_management.with_raw_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) @@ -161,7 +475,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: async with async_client.bot_management.with_streaming_response.update( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: @@ -175,7 +489,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.bot_management.with_raw_response.update( zone_id="", diff --git a/tests/api_resources/test_cache.py b/tests/api_resources/test_cache.py index d30f7f2a5a9..e3e932d5a24 100644 --- a/tests/api_resources/test_cache.py +++ b/tests/api_resources/test_cache.py @@ -19,7 +19,7 @@ class TestCache: @pytest.mark.skip() @parametrize - def test_method_purge(self, client: Cloudflare) -> None: + def test_method_purge_overload_1(self, client: Cloudflare) -> None: cache = client.cache.purge( zone_id="string", ) @@ -27,7 +27,211 @@ def test_method_purge(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_purge_with_all_params(self, client: Cloudflare) -> None: + def test_method_purge_with_all_params_overload_1(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + tags=["some-tag", "another-tag"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_purge_overload_1(self, client: Cloudflare) -> None: + response = client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_purge_overload_1(self, client: Cloudflare) -> None: + with client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_purge_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_purge_overload_2(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_purge_with_all_params_overload_2(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + hosts=["www.example.com", "images.example.com"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_purge_overload_2(self, client: Cloudflare) -> None: + response = client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_purge_overload_2(self, client: Cloudflare) -> None: + with client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_purge_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_purge_overload_3(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_purge_with_all_params_overload_3(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + prefixes=["www.example.com/foo", "images.example.com/bar/baz"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_purge_overload_3(self, client: Cloudflare) -> None: + response = client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_purge_overload_3(self, client: Cloudflare) -> None: + with client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_purge_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_purge_overload_4(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_purge_with_all_params_overload_4(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + purge_everything=True, + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_purge_overload_4(self, client: Cloudflare) -> None: + response = client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_purge_overload_4(self, client: Cloudflare) -> None: + with client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_purge_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_purge_overload_5(self, client: Cloudflare) -> None: + cache = client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_purge_with_all_params_overload_5(self, client: Cloudflare) -> None: cache = client.cache.purge( zone_id="string", files=[ @@ -35,16 +239,12 @@ def test_method_purge_with_all_params(self, client: Cloudflare) -> None: "http://www.example.com/css/styles.css", "http://www.example.com/css/styles.css", ], - hosts=["www.example.com", "images.example.com"], - prefixes=["www.example.com/foo", "images.example.com/bar/baz"], - purge_everything=True, - tags=["some-tag", "another-tag"], ) assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_purge(self, client: Cloudflare) -> None: + def test_raw_response_purge_overload_5(self, client: Cloudflare) -> None: response = client.cache.with_raw_response.purge( zone_id="string", ) @@ -56,7 +256,7 @@ def test_raw_response_purge(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_purge(self, client: Cloudflare) -> None: + def test_streaming_response_purge_overload_5(self, client: Cloudflare) -> None: with client.cache.with_streaming_response.purge( zone_id="string", ) as response: @@ -70,7 +270,7 @@ def test_streaming_response_purge(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_purge(self, client: Cloudflare) -> None: + def test_path_params_purge_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.cache.with_raw_response.purge( zone_id="", @@ -82,7 +282,7 @@ class TestAsyncCache: @pytest.mark.skip() @parametrize - async def test_method_purge(self, async_client: AsyncCloudflare) -> None: + async def test_method_purge_overload_1(self, async_client: AsyncCloudflare) -> None: cache = await async_client.cache.purge( zone_id="string", ) @@ -90,7 +290,211 @@ async def test_method_purge(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_purge_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_purge_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + tags=["some-tag", "another-tag"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_purge_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_purge_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_purge_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_overload_2(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + hosts=["www.example.com", "images.example.com"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_purge_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_purge_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_purge_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_overload_3(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + prefixes=["www.example.com/foo", "images.example.com/bar/baz"], + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_purge_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_purge_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_purge_overload_3(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_overload_4(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + purge_everything=True, + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_purge_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.with_raw_response.purge( + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_purge_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.with_streaming_response.purge( + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + cache = await response.parse() + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_purge_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.cache.with_raw_response.purge( + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_overload_5(self, async_client: AsyncCloudflare) -> None: + cache = await async_client.cache.purge( + zone_id="string", + ) + assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_purge_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: cache = await async_client.cache.purge( zone_id="string", files=[ @@ -98,16 +502,12 @@ async def test_method_purge_with_all_params(self, async_client: AsyncCloudflare) "http://www.example.com/css/styles.css", "http://www.example.com/css/styles.css", ], - hosts=["www.example.com", "images.example.com"], - prefixes=["www.example.com/foo", "images.example.com/bar/baz"], - purge_everything=True, - tags=["some-tag", "another-tag"], ) assert_matches_type(Optional[CachePurgeResponse], cache, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_purge(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_purge_overload_5(self, async_client: AsyncCloudflare) -> None: response = await async_client.cache.with_raw_response.purge( zone_id="string", ) @@ -119,7 +519,7 @@ async def test_raw_response_purge(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_purge(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_purge_overload_5(self, async_client: AsyncCloudflare) -> None: async with async_client.cache.with_streaming_response.purge( zone_id="string", ) as response: @@ -133,7 +533,7 @@ async def test_streaming_response_purge(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_purge(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_purge_overload_5(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.cache.with_raw_response.purge( zone_id="", diff --git a/tests/api_resources/test_pcaps.py b/tests/api_resources/test_pcaps.py index bcdf1e15059..ecb68279f4f 100644 --- a/tests/api_resources/test_pcaps.py +++ b/tests/api_resources/test_pcaps.py @@ -19,9 +19,10 @@ class TestPCAPs: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: pcap = client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -30,15 +31,93 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: pcap = client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, system="magic-transit", time_limit=300, type="simple", - byte_limit=500000, + filter_v1={ + "destination_address": "1.2.3.4", + "destination_port": 80, + "protocol": 6, + "source_address": "1.2.3.4", + "source_port": 123, + }, + ) + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: + response = client.pcaps.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pcap = response.parse() + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: + with client.pcaps.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pcap = response.parse() + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.pcaps.with_raw_response.create( + account_id="", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_2(self, client: Cloudflare) -> None: + pcap = client.pcaps.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", colo_name="ord02", destination_conf="s3://pcaps-bucket?region=us-east-1", + system="magic-transit", + time_limit=300, + type="simple", + ) + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + pcap = client.pcaps.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", + system="magic-transit", + time_limit=300, + type="simple", + byte_limit=500000, filter_v1={ "destination_address": "1.2.3.4", "destination_port": 80, @@ -52,9 +131,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.pcaps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", @@ -67,9 +148,11 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.pcaps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", @@ -84,10 +167,12 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.pcaps.with_raw_response.create( account_id="", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", @@ -193,9 +278,10 @@ class TestAsyncPCAPs: @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: pcap = await async_client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, system="magic-transit", time_limit=300, type="simple", @@ -204,15 +290,93 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: pcap = await async_client.pcaps.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, system="magic-transit", time_limit=300, type="simple", - byte_limit=500000, + filter_v1={ + "destination_address": "1.2.3.4", + "destination_port": 80, + "protocol": 6, + "source_address": "1.2.3.4", + "source_port": 123, + }, + ) + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.pcaps.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pcap = await response.parse() + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.pcaps.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pcap = await response.parse() + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.pcaps.with_raw_response.create( + account_id="", + packet_limit=10000, + system="magic-transit", + time_limit=300, + type="simple", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + pcap = await async_client.pcaps.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", colo_name="ord02", destination_conf="s3://pcaps-bucket?region=us-east-1", + system="magic-transit", + time_limit=300, + type="simple", + ) + assert_matches_type(PCAPCreateResponse, pcap, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + pcap = await async_client.pcaps.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", + system="magic-transit", + time_limit=300, + type="simple", + byte_limit=500000, filter_v1={ "destination_address": "1.2.3.4", "destination_port": 80, @@ -226,9 +390,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.pcaps.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", @@ -241,9 +407,11 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.pcaps.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", @@ -258,10 +426,12 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_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.pcaps.with_raw_response.create( account_id="", + colo_name="ord02", + destination_conf="s3://pcaps-bucket?region=us-east-1", system="magic-transit", time_limit=300, type="simple", diff --git a/tests/api_resources/workers/test_ai.py b/tests/api_resources/workers/test_ai.py index 6895c16e404..70a3311e1bb 100644 --- a/tests/api_resources/workers/test_ai.py +++ b/tests/api_resources/workers/test_ai.py @@ -19,31 +19,93 @@ class TestAI: @pytest.mark.skip() @parametrize - def test_method_run(self, client: Cloudflare) -> None: + def test_method_run_overload_1(self, client: Cloudflare) -> None: ai = client.workers.ai.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + text="string", ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_run_with_all_params(self, client: Cloudflare) -> None: + def test_raw_response_run_overload_1(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_1(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_2(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_2(self, client: Cloudflare) -> None: ai = client.workers.ai.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + prompt="string", + guidance=0, + image=[0, 0, 0], + mask=[0, 0, 0], + num_steps=0, + strength=0, ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_run(self, client: Cloudflare) -> None: + def test_raw_response_run_overload_2(self, client: Cloudflare) -> None: response = client.workers.ai.with_raw_response.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + prompt="string", ) assert response.is_closed is True @@ -53,11 +115,11 @@ def test_raw_response_run(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_run(self, client: Cloudflare) -> None: + def test_streaming_response_run_overload_2(self, client: Cloudflare) -> None: with client.workers.ai.with_streaming_response.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + prompt="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,52 +131,2031 @@ def test_streaming_response_run(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_run(self, client: Cloudflare) -> None: + def test_path_params_run_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): client.workers.ai.with_raw_response.run( "string", account_id="", - body={"text": "string"}, + prompt="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): client.workers.ai.with_raw_response.run( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + prompt="string", ) + @pytest.mark.skip() + @parametrize + def test_method_run_overload_3(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) -class TestAsyncAI: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_3(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_3(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + sentences=["string", "string", "string"], + source="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_4(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_4(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_4(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_5(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_5(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_5(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_6(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_6(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + audio=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_6(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_6(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_7(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_7(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_7(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_8(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_8(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + image=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_8(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_8(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_9(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_10(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_10(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + image=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_10(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_10(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_11(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_11(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + lora="string", + max_tokens=0, + raw=True, + stream=True, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_11(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_11(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + prompt="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_12(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_12(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + max_tokens=0, + stream=True, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_12(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_12(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_13(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_13(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + source_lang="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_13(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_13(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + target_lang="string", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_14(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_14(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + max_length=0, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_14(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_14(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + input_text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_15(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_15(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_15(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_15(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + def test_method_run_overload_16(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_run_with_all_params_overload_16(self, client: Cloudflare) -> None: + ai = client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + image=[0, 0, 0], + max_tokens=0, + prompt="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_run_overload_16(self, client: Cloudflare) -> None: + response = client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_run_overload_16(self, client: Cloudflare) -> None: + with client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_run_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncAI: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_1(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_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.workers.ai.with_raw_response.run( + "string", + account_id="", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_2(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + guidance=0, + image=[0, 0, 0], + mask=[0, 0, 0], + num_steps=0, + strength=0, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_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.workers.ai.with_raw_response.run( + "string", + account_id="", + prompt="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_3(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_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.workers.ai.with_raw_response.run( + "string", + account_id="", + sentences=["string", "string", "string"], + source="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + sentences=["string", "string", "string"], + source="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_4(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + text="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_5(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_6(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + audio=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_7(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_8(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + image=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_10(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + image=[0, 0, 0], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_11(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + lora="string", + max_tokens=0, + raw=True, + stream=True, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_11(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + prompt="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + prompt="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_12(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + max_tokens=0, + stream=True, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_12(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + messages=[ + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + { + "content": "string", + "role": "string", + }, + ], + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_13(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + source_lang="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_13(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + target_lang="string", + text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + target_lang="string", + text="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_14(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_run_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + max_length=0, + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_14(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_14(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_14(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + input_text="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + input_text="string", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_run_overload_15(self, async_client: AsyncCloudflare) -> None: + ai = await async_client.workers.ai.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_run_overload_15(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.ai.with_raw_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_run_overload_15(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.ai.with_streaming_response.run( + "string", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ai = await response.parse() + assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_run_overload_15(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "string", + account_id="", + body=b"raw file contents", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): + await async_client.workers.ai.with_raw_response.run( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + body=b"raw file contents", + ) @pytest.mark.skip() @parametrize - async def test_method_run(self, async_client: AsyncCloudflare) -> None: + async def test_method_run_overload_16(self, async_client: AsyncCloudflare) -> None: ai = await async_client.workers.ai.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_run_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_run_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: ai = await async_client.workers.ai.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, + image=[0, 0, 0], + max_tokens=0, + prompt="string", ) assert_matches_type(Optional[AIRunResponse], ai, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_run(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_run_overload_16(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.ai.with_raw_response.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, ) assert response.is_closed is True @@ -124,11 +2165,10 @@ async def test_raw_response_run(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_run(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_run_overload_16(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.ai.with_streaming_response.run( "string", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -140,17 +2180,15 @@ async def test_streaming_response_run(self, async_client: AsyncCloudflare) -> No @pytest.mark.skip() @parametrize - async def test_path_params_run(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_run_overload_16(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.workers.ai.with_raw_response.run( "string", account_id="", - body={"text": "string"}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_name` but received ''"): await async_client.workers.ai.with_raw_response.run( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body={"text": "string"}, ) diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 1a44a7bb73a..8ff9ba6b84c 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -27,7 +27,7 @@ class TestScripts: @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: script = client.workers.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -36,13 +36,12 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: script = client.workers.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", any_part_name=[b"raw file contents", b"raw file contents", b"raw file contents"], - message="string", metadata={ "bindings": [ { @@ -121,7 +120,70 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.workers.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.workers.scripts.with_streaming_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.workers.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + client.workers.scripts.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + script = client.workers.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + script = client.workers.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + message="string", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.workers.scripts.with_raw_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -134,7 +196,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.workers.scripts.with_streaming_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -149,7 +211,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + 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.workers.scripts.with_raw_response.update( "this-is_my_script-01", @@ -342,7 +404,7 @@ class TestAsyncScripts: @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -351,13 +413,12 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", any_part_name=[b"raw file contents", b"raw file contents", b"raw file contents"], - message="string", metadata={ "bindings": [ { @@ -436,7 +497,70 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = await response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.scripts.with_streaming_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = await response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.workers.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers.scripts.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + rollback_to="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + message="string", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers.scripts.with_raw_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -449,7 +573,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.workers.scripts.with_streaming_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -464,7 +588,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + 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.workers.scripts.with_raw_response.update( "this-is_my_script-01", diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index 517641faa80..7e6c865df3c 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -22,7 +22,7 @@ class TestScripts: @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -32,13 +32,12 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: script = client.workers_for_platforms.dispatch.namespaces.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", any_part_name=[b"raw file contents", b"raw file contents", b"raw file contents"], - message="string", metadata={ "bindings": [ { @@ -117,7 +116,82 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + script = client.workers_for_platforms.dispatch.namespaces.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + script = client.workers_for_platforms.dispatch.namespaces.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + message="string", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -131,7 +205,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -147,7 +221,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + 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.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( "this-is_my_script-01", @@ -314,7 +388,7 @@ class TestAsyncScripts: @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -324,13 +398,12 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", dispatch_namespace="my-dispatch-namespace", any_part_name=[b"raw file contents", b"raw file contents", b"raw file contents"], - message="string", metadata={ "bindings": [ { @@ -409,7 +482,82 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + script = await response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + script = await response.parse() + assert_matches_type(WorkersScript, script, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="", + dispatch_namespace="my-dispatch-namespace", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `dispatch_namespace` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `script_name` but received ''"): + await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( + "", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + script = await async_client.workers_for_platforms.dispatch.namespaces.scripts.update( + "this-is_my_script-01", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + dispatch_namespace="my-dispatch-namespace", + message="string", + ) + assert_matches_type(WorkersScript, script, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -423,7 +571,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.workers_for_platforms.dispatch.namespaces.scripts.with_streaming_response.update( "this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -439,7 +587,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + 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.workers_for_platforms.dispatch.namespaces.scripts.with_raw_response.update( "this-is_my_script-01", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 9cb5e6a1aa5..c416ee106ec 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -23,8 +23,10 @@ class TestApplications: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="string", ) @@ -32,8 +34,10 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -42,7 +46,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - app_launcher_visible={}, + app_launcher_visible=True, auto_redirect_to_identity=True, cors_headers={ "allow_all_headers": True, @@ -62,42 +66,26 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", path_cookie_attribute=True, - saas_app={ - "auth_type": "saml", - "consumer_service_url": "https://example.com", - "custom_attributes": { - "name": "family_name", - "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", - "source": {"name": "last_name"}, - }, - "default_relay_state": "https://example.com", - "idp_entity_id": "https://example.cloudflareaccess.com", - "name_id_format": "id", - "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", - "public_key": "example unique name", - "sp_entity_id": "example unique name", - "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", - }, same_site_cookie_attribute="strict", self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], service_auth_401_redirect=True, session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], - type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="string", ) @@ -109,8 +97,10 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="string", ) as response: @@ -124,24 +114,27 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + 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.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_2(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( account_id="string", zone_id="string", ) @@ -149,43 +142,24 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( account_id="string", zone_id="string", - allow_authenticate_via_warp=True, allowed_idps=[ "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - app_launcher_visible={}, + app_launcher_visible=True, auto_redirect_to_identity=True, - cors_headers={ - "allow_all_headers": True, - "allow_all_methods": True, - "allow_all_origins": True, - "allow_credentials": True, - "allowed_headers": [{}, {}, {}], - "allowed_methods": ["GET"], - "allowed_origins": ["https://example.com"], - "max_age": -1, - }, - custom_deny_message="string", - custom_deny_url="string", - custom_non_identity_deny_url="string", custom_pages=[ "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - domain="https://mybookmark.com", - enable_binding_cookie=True, - http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", - path_cookie_attribute=True, saas_app={ "auth_type": "saml", "consumer_service_url": "https://example.com", @@ -202,21 +176,15 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "sp_entity_id": "example unique name", "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", }, - same_site_cookie_attribute="strict", - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, - session_duration="24h", - skip_interstitial=True, tags=["engineers", "engineers", "engineers"], - type="bookmark", + type="saas", ) assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( account_id="string", zone_id="string", ) @@ -228,9 +196,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( account_id="string", zone_id="string", ) as response: @@ -244,43 +211,84 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.update( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.list( + def test_method_create_overload_3(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", ) - assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.list( + def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], ) - assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.list( + def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", ) @@ -288,12 +296,14 @@ 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" application = response.parse() - assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.list( + def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", ) as response: @@ -301,50 +311,94 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_create_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.list( + client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.list( + client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_4(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="vnc", account_id="string", zone_id="string", ) - assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="vnc", account_id="string", zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], ) - assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", account_id="string", zone_id="string", ) @@ -352,13 +406,14 @@ 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" application = response.parse() - assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="vnc", account_id="string", zone_id="string", ) as response: @@ -366,32 +421,34 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: + def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.delete( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.get( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_5(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="app_launcher", account_id="string", zone_id="string", ) @@ -399,19 +456,26 @@ def test_method_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.get( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="app_launcher", account_id="string", zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", ) assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", account_id="string", zone_id="string", ) @@ -423,9 +487,9 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + type="app_launcher", account_id="string", zone_id="string", ) as response: @@ -439,46 +503,53 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: + def test_path_params_create_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.get( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_revoke_tokens(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_6(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="warp", account_id="string", zone_id="string", ) - assert_matches_type(object, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_revoke_tokens_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="warp", account_id="string", zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", ) - assert_matches_type(object, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_revoke_tokens(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + type="warp", account_id="string", zone_id="string", ) @@ -486,13 +557,13 @@ def test_raw_response_revoke_tokens(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(object, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_revoke_tokens(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + type="warp", account_id="string", zone_id="string", ) as response: @@ -500,44 +571,187 @@ def test_streaming_response_revoke_tokens(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(object, application, path=["response"]) + assert_matches_type(AccessApps, application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_revoke_tokens(self, client: Cloudflare) -> None: + def test_path_params_create_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="warp", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.revoke_tokens( - "023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="warp", account_id="string", zone_id="", ) + @pytest.mark.skip() + @parametrize + def test_method_create_overload_7(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="biso", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) -class TestAsyncApplications: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="biso", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - application = await async_client.zero_trust.access.applications.create( + def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + type="biso", account_id="string", zone_id="string", ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - application = await async_client.zero_trust.access.applications.create( + def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + type="biso", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.create( + type="biso", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.create( + type="biso", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_8(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + app_launcher_visible={}, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + tags=["engineers", "engineers", "engineers"], + type="bookmark", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.create( + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_1(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -546,7 +760,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - app_launcher_visible={}, + app_launcher_visible=True, auto_redirect_to_identity=True, cors_headers={ "allow_all_headers": True, @@ -566,12 +780,106 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", saas_app={ "auth_type": "saml", "consumer_service_url": "https://example.com", @@ -588,64 +896,65 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "sp_entity_id": "example unique name", "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", }, - same_site_cookie_attribute="strict", - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, - session_duration="24h", - skip_interstitial=True, tags=["engineers", "engineers", "engineers"], - type="bookmark", + type="saas", ) assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.access.applications.with_raw_response.create( + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="string", zone_id="string", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - application = await response.parse() + application = response.parse() assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.access.applications.with_streaming_response.create( + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="string", zone_id="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - application = await response.parse() + application = response.parse() assert_matches_type(AccessApps, application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + 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 ''"): - await async_client.zero_trust.access.applications.with_raw_response.create( + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zero_trust.access.applications.with_raw_response.create( + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: - application = await async_client.zero_trust.access.applications.update( + def test_method_update_overload_3(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", ) @@ -653,9 +962,11 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - application = await async_client.zero_trust.access.applications.update( + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", account_id="string", zone_id="string", allow_authenticate_via_warp=True, @@ -664,7 +975,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - app_launcher_visible={}, + app_launcher_visible=True, auto_redirect_to_identity=True, cors_headers={ "allow_all_headers": True, @@ -684,41 +995,2198 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "699d98642c564d2e855e9661899b7252", "699d98642c564d2e855e9661899b7252", ], - domain="https://mybookmark.com", enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", path_cookie_attribute=True, - saas_app={ - "auth_type": "saml", - "consumer_service_url": "https://example.com", - "custom_attributes": { - "name": "family_name", - "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", - "source": {"name": "last_name"}, - }, - "default_relay_state": "https://example.com", - "idp_entity_id": "https://example.cloudflareaccess.com", - "name_id_format": "id", - "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", - "public_key": "example unique name", - "sp_entity_id": "example unique name", - "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_4(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, same_site_cookie_attribute="strict", self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], service_auth_401_redirect=True, session_duration="24h", skip_interstitial=True, tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_5(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_6(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_7(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_8(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + app_launcher_visible={}, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + tags=["engineers", "engineers", "engineers"], + type="bookmark", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.list( + account_id="string", + zone_id="string", + ) + assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.list( + account_id="string", + zone_id="string", + ) + assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.list( + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.list( + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(Optional[ApplicationListResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.list( + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.list( + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_delete_with_all_params(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(ApplicationDeleteResponse, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.delete( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.get( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_revoke_tokens(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(object, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_revoke_tokens_with_all_params(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(object, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_revoke_tokens(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(object, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_revoke_tokens(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(object, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_revoke_tokens(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.revoke_tokens( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="", + ) + + +class TestAsyncApplications: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + saas_app={ + "auth_type": "saml", + "consumer_service_url": "https://example.com", + "custom_attributes": { + "name": "family_name", + "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "source": {"name": "last_name"}, + }, + "default_relay_state": "https://example.com", + "idp_entity_id": "https://example.cloudflareaccess.com", + "name_id_format": "id", + "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", + "public_key": "example unique name", + "sp_entity_id": "example unique name", + "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", + }, + tags=["engineers", "engineers", "engineers"], + type="saas", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_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.zero_trust.access.applications.with_raw_response.create( + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_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.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="app_launcher", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="app_launcher", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + type="app_launcher", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="app_launcher", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="warp", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="warp", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + type="warp", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + type="warp", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="warp", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="warp", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="biso", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + type="biso", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + type="biso", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + type="biso", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="biso", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + type="biso", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + account_id="string", + zone_id="string", + app_launcher_visible={}, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + tags=["engineers", "engineers", "engineers"], + type="bookmark", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + saas_app={ + "auth_type": "saml", + "consumer_service_url": "https://example.com", + "custom_attributes": { + "name": "family_name", + "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "source": {"name": "last_name"}, + }, + "default_relay_state": "https://example.com", + "idp_entity_id": "https://example.cloudflareaccess.com", + "name_id_format": "id", + "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", + "public_key": "example unique name", + "sp_entity_id": "example unique name", + "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", + }, + tags=["engineers", "engineers", "engineers"], + type="saas", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="ssh", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + allow_authenticate_via_warp=True, + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": [{}, {}, {}], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="string", + custom_deny_url="string", + custom_non_identity_deny_url="string", + custom_pages=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + path_cookie_attribute=True, + same_site_cookie_attribute="strict", + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers", "engineers", "engineers"], + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="vnc", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="app_launcher", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="warp", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + allowed_idps=[ + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + "699d98642c564d2e855e9661899b7252", + ], + auto_redirect_to_identity=True, + session_duration="24h", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(AccessApps, application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + "023e105f4ecef8ad9ca31a8372d0c353", + type="biso", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessApps, application, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + "023e105f4ecef8ad9ca31a8372d0c353", + account_id="string", + zone_id="string", + app_launcher_visible={}, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + tags=["engineers", "engineers", "engineers"], type="bookmark", ) assert_matches_type(AccessApps, application, path=["response"]) @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", account_id="string", @@ -732,7 +3200,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( "023e105f4ecef8ad9ca31a8372d0c353", account_id="string", @@ -748,7 +3216,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( "023e105f4ecef8ad9ca31a8372d0c353", diff --git a/tests/api_resources/zero_trust/test_identity_providers.py b/tests/api_resources/zero_trust/test_identity_providers.py index d93d5cdb964..d7c5d1ee833 100644 --- a/tests/api_resources/zero_trust/test_identity_providers.py +++ b/tests/api_resources/zero_trust/test_identity_providers.py @@ -23,7 +23,7 @@ class TestIdentityProviders: @pytest.mark.skip() @parametrize - def test_method_create(self, client: Cloudflare) -> None: + def test_method_create_overload_1(self, client: Cloudflare) -> None: identity_provider = client.zero_trust.identity_providers.create( config={}, name="Widget Corps IDP", @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_create_with_all_params(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: identity_provider = client.zero_trust.identity_providers.create( config={ "client_id": "", @@ -46,37 +46,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "directory_id": "", "prompt": "login", "support_groups": True, - "centrify_account": "https://abc123.my.centrify.com/", - "centrify_app_id": "exampleapp", - "apps_domain": "mycompany.com", - "auth_url": "https://accounts.google.com/o/oauth2/auth", - "certs_url": "https://www.googleapis.com/oauth2/v3/certs", - "scopes": ["openid", "email", "profile"], - "token_url": "https://accounts.google.com/o/oauth2/token", - "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", - "okta_account": "https://dev-abc123.oktapreview.com", - "onelogin_account": "https://mycompany.onelogin.com", - "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", - "attributes": ["group", "department_code", "divison"], - "email_attribute_name": "Email", - "header_attributes": [ - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - ], - "idp_public_certs": ["string", "string", "string"], - "issuer_url": "https://whoami.com", - "sign_request": True, - "sso_target_url": "https://edgeaccess.org/idp/saml/login", }, name="Widget Corps IDP", type="onetimepin", @@ -94,7 +63,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_create(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", @@ -110,7 +79,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_create(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.zero_trust.identity_providers.with_streaming_response.create( config={}, name="Widget Corps IDP", @@ -128,7 +97,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_create(self, client: Cloudflare) -> None: + 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.zero_trust.identity_providers.with_raw_response.create( config={}, @@ -149,9 +118,8 @@ def test_path_params_create(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_overload_2(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( config={}, name="Widget Corps IDP", type="onetimepin", @@ -162,49 +130,15 @@ def test_method_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_update_with_all_params(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( config={ "client_id": "", "client_secret": "", "claims": ["email_verified", "preferred_username", "custom_claim_name"], "email_claim_name": "custom_claim_name", - "conditional_access_enabled": True, - "directory_id": "", - "prompt": "login", - "support_groups": True, "centrify_account": "https://abc123.my.centrify.com/", "centrify_app_id": "exampleapp", - "apps_domain": "mycompany.com", - "auth_url": "https://accounts.google.com/o/oauth2/auth", - "certs_url": "https://www.googleapis.com/oauth2/v3/certs", - "scopes": ["openid", "email", "profile"], - "token_url": "https://accounts.google.com/o/oauth2/token", - "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", - "okta_account": "https://dev-abc123.oktapreview.com", - "onelogin_account": "https://mycompany.onelogin.com", - "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", - "attributes": ["group", "department_code", "divison"], - "email_attribute_name": "Email", - "header_attributes": [ - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - ], - "idp_public_certs": ["string", "string", "string"], - "issuer_url": "https://whoami.com", - "sign_request": True, - "sso_target_url": "https://edgeaccess.org/idp/saml/login", }, name="Widget Corps IDP", type="onetimepin", @@ -222,9 +156,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_raw_response_update(self, client: Cloudflare) -> None: - response = client.zero_trust.identity_providers.with_raw_response.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", type="onetimepin", @@ -239,9 +172,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_update(self, client: Cloudflare) -> None: - with client.zero_trust.identity_providers.with_streaming_response.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( config={}, name="Widget Corps IDP", type="onetimepin", @@ -258,20 +190,9 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_update(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): - client.zero_trust.identity_providers.with_raw_response.update( - "", - config={}, - name="Widget Corps IDP", - type="onetimepin", - account_id="string", - zone_id="string", - ) - + def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", type="onetimepin", @@ -280,8 +201,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.update( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + client.zero_trust.identity_providers.with_raw_response.create( config={}, name="Widget Corps IDP", type="onetimepin", @@ -291,26 +211,45 @@ def test_path_params_update(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_list(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.list( + def test_method_create_overload_3(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) - assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.list( + def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, ) - assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.identity_providers.with_raw_response.list( + def test_raw_response_create_overload_3(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) @@ -318,12 +257,15 @@ 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" identity_provider = response.parse() - assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.identity_providers.with_streaming_response.list( + def test_streaming_response_create_overload_3(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) as response: @@ -331,50 +273,72 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_create_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.list( + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.list( + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_overload_4(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) - assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_method_delete_with_all_params(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, ) - assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.zero_trust.identity_providers.with_raw_response.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_raw_response_create_overload_4(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) @@ -382,13 +346,15 @@ 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" identity_provider = response.parse() - assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.zero_trust.identity_providers.with_streaming_response.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_streaming_response_create_overload_4(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) as response: @@ -396,39 +362,38 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" identity_provider = response.parse() - assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip() @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): - client.zero_trust.identity_providers.with_raw_response.delete( - "", - account_id="string", - zone_id="string", - ) - + def test_path_params_create_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.delete( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="", ) @pytest.mark.skip() @parametrize - def test_method_get(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.get( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_overload_5(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) @@ -436,19 +401,35 @@ def test_method_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_method_get_with_all_params(self, client: Cloudflare) -> None: - identity_provider = client.zero_trust.identity_providers.get( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_method_create_with_all_params_overload_5(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + }, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, ) assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) @pytest.mark.skip() @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.zero_trust.identity_providers.with_raw_response.get( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_raw_response_create_overload_5(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) @@ -460,9 +441,11 @@ def test_raw_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.zero_trust.identity_providers.with_streaming_response.get( - "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + def test_streaming_response_create_overload_5(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="string", ) as response: @@ -476,36 +459,5072 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: @pytest.mark.skip() @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): - client.zero_trust.identity_providers.with_raw_response.get( - "", - account_id="string", + def test_path_params_create_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_6(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_6(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "apps_domain": "mycompany.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_6(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_6(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_7(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_7(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_7(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_7(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_8(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_8(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "auth_url": "https://accounts.google.com/o/oauth2/auth", + "certs_url": "https://www.googleapis.com/oauth2/v3/certs", + "scopes": ["openid", "email", "profile"], + "token_url": "https://accounts.google.com/o/oauth2/token", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_8(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_8(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_9(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", + "okta_account": "https://dev-abc123.oktapreview.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_9(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_9(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_10(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_10(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "onelogin_account": "https://mycompany.onelogin.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_10(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_10(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_11(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_11(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_11(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_12(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "attributes": ["group", "department_code", "divison"], + "email_attribute_name": "Email", + "header_attributes": [ + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + ], + "idp_public_certs": ["string", "string", "string"], + "issuer_url": "https://whoami.com", + "sign_request": True, + "sso_target_url": "https://edgeaccess.org/idp/saml/login", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_13(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_create_overload_14(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_create_with_all_params_overload_14(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_create_overload_14(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_create_overload_14(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_create_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_1(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "conditional_access_enabled": True, + "directory_id": "", + "prompt": "login", + "support_groups": True, + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "centrify_account": "https://abc123.my.centrify.com/", + "centrify_app_id": "exampleapp", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_3(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_3(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_4(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_4(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_5(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_5(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_6(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "apps_domain": "mycompany.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_6(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_7(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_7(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_8(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "auth_url": "https://accounts.google.com/o/oauth2/auth", + "certs_url": "https://www.googleapis.com/oauth2/v3/certs", + "scopes": ["openid", "email", "profile"], + "token_url": "https://accounts.google.com/o/oauth2/token", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_8(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_9(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", + "okta_account": "https://dev-abc123.oktapreview.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_10(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "onelogin_account": "https://mycompany.onelogin.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_11(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_11(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_11(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_11(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_12(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "attributes": ["group", "department_code", "divison"], + "email_attribute_name": "Email", + "header_attributes": [ + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + ], + "idp_public_certs": ["string", "string", "string"], + "issuer_url": "https://whoami.com", + "sign_request": True, + "sso_target_url": "https://edgeaccess.org/idp/saml/login", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_13(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_update_overload_14(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_update_with_all_params_overload_14(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_update_overload_14(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_update_overload_14(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_update_overload_14(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.list( + account_id="string", + zone_id="string", + ) + assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.list( + account_id="string", + zone_id="string", + ) + assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.list( + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.list( + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(Optional[IdentityProviderListResponse], identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.list( + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.list( + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_delete_with_all_params(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(IdentityProviderDeleteResponse, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.delete( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.delete( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + identity_provider = client.zero_trust.identity_providers.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.identity_providers.with_raw_response.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.identity_providers.with_streaming_response.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.zero_trust.identity_providers.with_raw_response.get( + "", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.zero_trust.identity_providers.with_raw_response.get( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="string", + zone_id="", + ) + + +class TestAsyncIdentityProviders: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "conditional_access_enabled": True, + "directory_id": "", + "prompt": "login", + "support_groups": True, + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "centrify_account": "https://abc123.my.centrify.com/", + "centrify_app_id": "exampleapp", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_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.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_3(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_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.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_4(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_5(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_6(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "apps_domain": "mycompany.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_7(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_8(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "auth_url": "https://accounts.google.com/o/oauth2/auth", + "certs_url": "https://www.googleapis.com/oauth2/v3/certs", + "scopes": ["openid", "email", "profile"], + "token_url": "https://accounts.google.com/o/oauth2/token", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_9(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", + "okta_account": "https://dev-abc123.oktapreview.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "onelogin_account": "https://mycompany.onelogin.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "attributes": ["group", "department_code", "divison"], + "email_attribute_name": "Email", + "header_attributes": [ + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + { + "attribute_name": "string", + "header_name": "string", + }, + ], + "idp_public_certs": ["string", "string", "string"], + "issuer_url": "https://whoami.com", + "sign_request": True, + "sso_target_url": "https://edgeaccess.org/idp/saml/login", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_create_overload_14(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_create_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_create_overload_14(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_create_overload_14(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.create( + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "conditional_access_enabled": True, + "directory_id": "", + "prompt": "login", + "support_groups": True, + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "centrify_account": "https://abc123.my.centrify.com/", + "centrify_app_id": "exampleapp", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_3(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @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 `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_4(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_4(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_4(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_4(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_5(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_5(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_5(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_5(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_6(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_6(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "apps_domain": "mycompany.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_6(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_6(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_7(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_7(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_7(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "auth_url": "https://accounts.google.com/o/oauth2/auth", + "certs_url": "https://www.googleapis.com/oauth2/v3/certs", + "scopes": ["openid", "email", "profile"], + "token_url": "https://accounts.google.com/o/oauth2/token", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", + "okta_account": "https://dev-abc123.oktapreview.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "onelogin_account": "https://mycompany.onelogin.com", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={ + "client_id": "", + "client_secret": "", + "claims": ["email_verified", "preferred_username", "custom_claim_name"], + "email_claim_name": "custom_claim_name", + "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", + }, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.get( + await async_client.zero_trust.identity_providers.with_raw_response.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="", zone_id="string", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.zero_trust.identity_providers.with_raw_response.get( + await async_client.zero_trust.identity_providers.with_raw_response.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", account_id="string", zone_id="", ) - -class TestAsyncIdentityProviders: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() @parametrize - async def test_method_create(self, async_client: AsyncCloudflare) -> None: - identity_provider = await async_client.zero_trust.identity_providers.create( + async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, name="Widget Corps IDP", type="onetimepin", @@ -516,28 +5535,10 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - identity_provider = await async_client.zero_trust.identity_providers.create( + async def test_method_update_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={ - "client_id": "", - "client_secret": "", - "claims": ["email_verified", "preferred_username", "custom_claim_name"], - "email_claim_name": "custom_claim_name", - "conditional_access_enabled": True, - "directory_id": "", - "prompt": "login", - "support_groups": True, - "centrify_account": "https://abc123.my.centrify.com/", - "centrify_app_id": "exampleapp", - "apps_domain": "mycompany.com", - "auth_url": "https://accounts.google.com/o/oauth2/auth", - "certs_url": "https://www.googleapis.com/oauth2/v3/certs", - "scopes": ["openid", "email", "profile"], - "token_url": "https://accounts.google.com/o/oauth2/token", - "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", - "okta_account": "https://dev-abc123.oktapreview.com", - "onelogin_account": "https://mycompany.onelogin.com", - "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", "attributes": ["group", "department_code", "divison"], "email_attribute_name": "Email", "header_attributes": [ @@ -575,8 +5576,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: - response = await async_client.zero_trust.identity_providers.with_raw_response.create( + async def test_raw_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, name="Widget Corps IDP", type="onetimepin", @@ -591,8 +5593,9 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: - async with async_client.zero_trust.identity_providers.with_streaming_response.create( + async def test_streaming_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, name="Widget Corps IDP", type="onetimepin", @@ -609,9 +5612,20 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_12(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.zero_trust.identity_providers.with_raw_response.create( + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, name="Widget Corps IDP", type="onetimepin", @@ -620,7 +5634,8 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.zero_trust.identity_providers.with_raw_response.create( + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, name="Widget Corps IDP", type="onetimepin", @@ -630,7 +5645,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> None: identity_provider = await async_client.zero_trust.identity_providers.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -643,49 +5658,12 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: identity_provider = await async_client.zero_trust.identity_providers.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={ "client_id": "", "client_secret": "", - "claims": ["email_verified", "preferred_username", "custom_claim_name"], - "email_claim_name": "custom_claim_name", - "conditional_access_enabled": True, - "directory_id": "", - "prompt": "login", - "support_groups": True, - "centrify_account": "https://abc123.my.centrify.com/", - "centrify_app_id": "exampleapp", - "apps_domain": "mycompany.com", - "auth_url": "https://accounts.google.com/o/oauth2/auth", - "certs_url": "https://www.googleapis.com/oauth2/v3/certs", - "scopes": ["openid", "email", "profile"], - "token_url": "https://accounts.google.com/o/oauth2/token", - "authorization_server_id": "aus9o8wzkhckw9TLa0h7z", - "okta_account": "https://dev-abc123.oktapreview.com", - "onelogin_account": "https://mycompany.onelogin.com", - "ping_env_id": "342b5660-0c32-4936-a5a4-ce21fae57b0a", - "attributes": ["group", "department_code", "divison"], - "email_attribute_name": "Email", - "header_attributes": [ - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - { - "attribute_name": "string", - "header_name": "string", - }, - ], - "idp_public_certs": ["string", "string", "string"], - "issuer_url": "https://whoami.com", - "sign_request": True, - "sso_target_url": "https://edgeaccess.org/idp/saml/login", }, name="Widget Corps IDP", type="onetimepin", @@ -703,7 +5681,109 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare @pytest.mark.skip() @parametrize - async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_streaming_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.identity_providers.with_streaming_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + identity_provider = await response.parse() + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip() + @parametrize + async def test_path_params_update_overload_13(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="", + zone_id="string", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.zero_trust.identity_providers.with_raw_response.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="", + ) + + @pytest.mark.skip() + @parametrize + async def test_method_update_overload_14(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_method_update_with_all_params_overload_14(self, async_client: AsyncCloudflare) -> None: + identity_provider = await async_client.zero_trust.identity_providers.update( + "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + config={}, + name="Widget Corps IDP", + type="onetimepin", + account_id="string", + zone_id="string", + scim_config={ + "enabled": True, + "group_member_deprovision": True, + "seat_deprovision": True, + "secret": "string", + "user_deprovision": True, + }, + ) + assert_matches_type(AccessIdentityProviders, identity_provider, path=["response"]) + + @pytest.mark.skip() + @parametrize + async def test_raw_response_update_overload_14(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.identity_providers.with_raw_response.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -720,7 +5800,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip() @parametrize - async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_14(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.identity_providers.with_streaming_response.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", config={}, @@ -739,7 +5819,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> @pytest.mark.skip() @parametrize - async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_14(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): await async_client.zero_trust.identity_providers.with_raw_response.update( "",