diff --git a/.stats.yml b/.stats.yml index 99f947826a0..1682359bc84 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2184 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d7d43f051a510c54ae71adb4b85cbb422565a40942cde4de0c3f8eb6ba8023b.yml -openapi_spec_hash: e85824f16c3ba923a34e514c06dac7cd -config_hash: a84b6a70b6374c30a50b477fe248eb3a +configured_endpoints: 2194 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ce49e6bb0d3819f135b9a567b661205fdf5df21cff157eab2b7abd7b5b50347.yml +openapi_spec_hash: 512a5bb3a32860590c8949765605d65a +config_hash: 5367ae3e3a9a0d6578c2756965a99e3a diff --git a/README.md b/README.md index c9b0fb08c36..6b81dde75a4 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ It is generated with [Stainless](https://www.stainless.com/). Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIkNMT1VERkxBUkVfRU1BSUwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiQ0xPVURGTEFSRV9BUElfVVNFUl9TRVJWSUNFX0tFWSI6InYxLjAtMTQ0YzlkZWZhYzA0OTY5YzdiZmFkOGVmLTYzMWE0MWQwMDNhMzJkMjVmZTg3ODA4MWVmMzY1YzQ5NTAzZjdmYWRhNjAwZGE5MzVlMjg1MWExYzczMjYwODRiODVjYmY2NDI5YzRiODU5ZGU4NDc1NzMxZGM5MmE5YzMyOTYzMWU2ZDU5ZTZjNzNkYTdiMTk4NDk3MTcyYjRjZWZlMDcxZDkwZDBmNWQyNzE5IiwiQ0xPVURGTEFSRV9BQ0NPVU5UX0lEIjoiZjAzN2U1NmU4OTI5M2EwNTc3NDBkZTY4MWFjOWFjY3AiLCJDTE9VREZMQVJFX1pPTkVfSUQiOiJmMDM3ZTU2ZTg5MjkzYTA1Nzc0MGRlNjgxYWM5YWNjcCJ9fQ) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%2C%22CLOUDFLARE_ACCOUNT_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%2C%22CLOUDFLARE_ZONE_ID%22%3A%22f037e56e89293a057740de681ac9accp%22%7D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl0sImVudiI6eyJDTE9VREZMQVJFX0FQSV9UT0tFTiI6IlNuM2xaSlRCWDZra2c3T2RjQlVBeE9POTYzR0VJeUdRcW5GVE9GWVkiLCJDTE9VREZMQVJFX0FQSV9LRVkiOiIxNDRjOWRlZmFjMDQ5NjljN2JmYWQ4ZWZhYThlYTE5NCIsIkNMT1VERkxBUkVfRU1BSUwiOiJ1c2VyQGV4YW1wbGUuY29tIiwiQ0xPVURGTEFSRV9BUElfVVNFUl9TRVJWSUNFX0tFWSI6InYxLjAtMTQ0YzlkZWZhYzA0OTY5YzdiZmFkOGVmLTYzMWE0MWQwMDNhMzJkMjVmZTg3ODA4MWVmMzY1YzQ5NTAzZjdmYWRhNjAwZGE5MzVlMjg1MWExYzczMjYwODRiODVjYmY2NDI5YzRiODU5ZGU4NDc1NzMxZGM5MmE5YzMyOTYzMWU2ZDU5ZTZjNzNkYTdiMTk4NDk3MTcyYjRjZWZlMDcxZDkwZDBmNWQyNzE5In19) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%2C%22env%22%3A%7B%22CLOUDFLARE_API_TOKEN%22%3A%22Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY%22%2C%22CLOUDFLARE_API_KEY%22%3A%22144c9defac04969c7bfad8efaa8ea194%22%2C%22CLOUDFLARE_EMAIL%22%3A%22user%40example.com%22%2C%22CLOUDFLARE_API_USER_SERVICE_KEY%22%3A%22v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719%22%7D%7D) > Note: You may need to set environment variables in your MCP client. diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 898c9afa236..0b725b76e84 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -311,8 +311,6 @@ class Cloudflare(SyncAPIClient): api_key: str | None api_email: str | None user_service_key: str | None - account_id: str | None - zone_id: str | None def __init__( self, @@ -321,8 +319,6 @@ def __init__( api_key: str | None = None, api_email: str | None = None, user_service_key: str | None = None, - account_id: str | None = None, - zone_id: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, timeout: float | Timeout | None | NotGiven = not_given, @@ -350,8 +346,6 @@ def __init__( - `api_key` from `CLOUDFLARE_API_KEY` - `api_email` from `CLOUDFLARE_EMAIL` - `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY` - - `account_id` from `CLOUDFLARE_ACCOUNT_ID` - - `zone_id` from `CLOUDFLARE_ZONE_ID` """ if api_token is None: api_token = os.environ.get("CLOUDFLARE_API_TOKEN") @@ -369,14 +363,6 @@ def __init__( user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY") self.user_service_key = user_service_key - if account_id is None: - account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID") - self.account_id = account_id - - if zone_id is None: - zone_id = os.environ.get("CLOUDFLARE_ZONE_ID") - self.zone_id = zone_id - if base_url is None: base_url = os.environ.get("CLOUDFLARE_BASE_URL") if base_url is None: @@ -1123,8 +1109,6 @@ def copy( api_key: str | None = None, api_email: str | None = None, user_service_key: str | None = None, - account_id: str | None = None, - zone_id: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, timeout: float | Timeout | None | NotGiven = not_given, @@ -1163,8 +1147,6 @@ def copy( api_key=api_key or self.api_key, api_email=api_email or self.api_email, user_service_key=user_service_key or self.user_service_key, - account_id=account_id or self.account_id, - zone_id=zone_id or self.zone_id, base_url=base_url or self.base_url, api_version=api_version or self.api_version, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, @@ -1179,24 +1161,6 @@ def copy( # client.with_options(timeout=10).foo.create(...) with_options = copy - def _get_account_id_path_param(self) -> str: - from_client = self.account_id - if from_client is not None: - return from_client - - raise ValueError( - "Missing account_id argument; Please provide it at the client level, e.g. Cloudflare(account_id='abcd') or per method." - ) - - def _get_zone_id_path_param(self) -> str: - from_client = self.zone_id - if from_client is not None: - return from_client - - raise ValueError( - "Missing zone_id argument; Please provide it at the client level, e.g. Cloudflare(zone_id='abcd') or per method." - ) - @override def _make_status_error( self, @@ -1237,8 +1201,6 @@ class AsyncCloudflare(AsyncAPIClient): api_key: str | None api_email: str | None user_service_key: str | None - account_id: str | None - zone_id: str | None def __init__( self, @@ -1247,8 +1209,6 @@ def __init__( api_key: str | None = None, api_email: str | None = None, user_service_key: str | None = None, - account_id: str | None = None, - zone_id: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, timeout: float | Timeout | None | NotGiven = not_given, @@ -1276,8 +1236,6 @@ def __init__( - `api_key` from `CLOUDFLARE_API_KEY` - `api_email` from `CLOUDFLARE_EMAIL` - `user_service_key` from `CLOUDFLARE_API_USER_SERVICE_KEY` - - `account_id` from `CLOUDFLARE_ACCOUNT_ID` - - `zone_id` from `CLOUDFLARE_ZONE_ID` """ if api_token is None: api_token = os.environ.get("CLOUDFLARE_API_TOKEN") @@ -1295,14 +1253,6 @@ def __init__( user_service_key = os.environ.get("CLOUDFLARE_API_USER_SERVICE_KEY") self.user_service_key = user_service_key - if account_id is None: - account_id = os.environ.get("CLOUDFLARE_ACCOUNT_ID") - self.account_id = account_id - - if zone_id is None: - zone_id = os.environ.get("CLOUDFLARE_ZONE_ID") - self.zone_id = zone_id - if base_url is None: base_url = os.environ.get("CLOUDFLARE_BASE_URL") if base_url is None: @@ -2049,8 +1999,6 @@ def copy( api_key: str | None = None, api_email: str | None = None, user_service_key: str | None = None, - account_id: str | None = None, - zone_id: str | None = None, base_url: str | httpx.URL | None = None, api_version: str | None = None, timeout: float | Timeout | None | NotGiven = not_given, @@ -2089,8 +2037,6 @@ def copy( api_key=api_key or self.api_key, api_email=api_email or self.api_email, user_service_key=user_service_key or self.user_service_key, - account_id=account_id or self.account_id, - zone_id=zone_id or self.zone_id, base_url=base_url or self.base_url, api_version=api_version or self.api_version, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, @@ -2105,24 +2051,6 @@ def copy( # client.with_options(timeout=10).foo.create(...) with_options = copy - def _get_account_id_path_param(self) -> str: - from_client = self.account_id - if from_client is not None: - return from_client - - raise ValueError( - "Missing account_id argument; Please provide it at the client level, e.g. AsyncCloudflare(account_id='abcd') or per method." - ) - - def _get_zone_id_path_param(self) -> str: - from_client = self.zone_id - if from_client is not None: - return from_client - - raise ValueError( - "Missing zone_id argument; Please provide it at the client level, e.g. AsyncCloudflare(zone_id='abcd') or per method." - ) - @override def _make_status_error( self, diff --git a/src/cloudflare/resources/abuse_reports/abuse_reports.py b/src/cloudflare/resources/abuse_reports/abuse_reports.py index e1e4c79487a..4d6352c1025 100644 --- a/src/cloudflare/resources/abuse_reports/abuse_reports.py +++ b/src/cloudflare/resources/abuse_reports/abuse_reports.py @@ -65,7 +65,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_dmca"], address1: str, agent_name: str, @@ -175,7 +175,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_trademark"], email: str, email2: str, @@ -266,7 +266,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_general"], email: str, email2: str, @@ -364,7 +364,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_phishing"], email: str, email2: str, @@ -450,7 +450,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_children"], email: str, email2: str, @@ -540,7 +540,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_threat"], email: str, email2: str, @@ -622,7 +622,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_registrar_whois"], email: str, email2: str, @@ -698,7 +698,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_ncsei"], email: str, email2: str, @@ -779,6 +779,7 @@ def create( @required_args( [ + "account_id", "act", "address1", "agent_name", @@ -796,6 +797,7 @@ def create( "urls", ], [ + "account_id", "act", "email", "email2", @@ -808,8 +810,19 @@ def create( "trademark_symbol", "urls", ], - ["act", "email", "email2", "host_notification", "justification", "name", "owner_notification", "urls"], [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "urls", + ], + [ + "account_id", "act", "email", "email2", @@ -820,8 +833,9 @@ def create( "owner_notification", "urls", ], - ["act", "email", "email2", "name", "owner_notification", "urls"], + ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"], [ + "account_id", "act", "email", "email2", @@ -836,7 +850,7 @@ def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_dmca"] | Literal["abuse_trademark"] | Literal["abuse_general"] @@ -882,8 +896,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_param: @@ -941,7 +953,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, created_after: str | Omit = omit, created_before: str | Omit = omit, domain: str | Omit = omit, @@ -988,8 +1000,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -1022,7 +1032,7 @@ def get( self, report_param: str, *, - account_id: str | None = None, + account_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, @@ -1042,8 +1052,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_param: @@ -1092,7 +1100,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_dmca"], address1: str, agent_name: str, @@ -1202,7 +1210,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_trademark"], email: str, email2: str, @@ -1293,7 +1301,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_general"], email: str, email2: str, @@ -1391,7 +1399,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_phishing"], email: str, email2: str, @@ -1477,7 +1485,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_children"], email: str, email2: str, @@ -1567,7 +1575,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_threat"], email: str, email2: str, @@ -1649,7 +1657,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_registrar_whois"], email: str, email2: str, @@ -1725,7 +1733,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_ncsei"], email: str, email2: str, @@ -1806,6 +1814,7 @@ async def create( @required_args( [ + "account_id", "act", "address1", "agent_name", @@ -1823,6 +1832,7 @@ async def create( "urls", ], [ + "account_id", "act", "email", "email2", @@ -1835,8 +1845,19 @@ async def create( "trademark_symbol", "urls", ], - ["act", "email", "email2", "host_notification", "justification", "name", "owner_notification", "urls"], [ + "account_id", + "act", + "email", + "email2", + "host_notification", + "justification", + "name", + "owner_notification", + "urls", + ], + [ + "account_id", "act", "email", "email2", @@ -1847,8 +1868,9 @@ async def create( "owner_notification", "urls", ], - ["act", "email", "email2", "name", "owner_notification", "urls"], + ["account_id", "act", "email", "email2", "name", "owner_notification", "urls"], [ + "account_id", "act", "email", "email2", @@ -1863,7 +1885,7 @@ async def create( self, report_param: str, *, - account_id: str | None = None, + account_id: str, act: Literal["abuse_dmca"] | Literal["abuse_trademark"] | Literal["abuse_general"] @@ -1909,8 +1931,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_param: @@ -1968,7 +1988,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, created_after: str | Omit = omit, created_before: str | Omit = omit, domain: str | Omit = omit, @@ -2015,8 +2035,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -2049,7 +2067,7 @@ async def get( self, report_param: str, *, - account_id: str | None = None, + account_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, @@ -2069,8 +2087,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_param: diff --git a/src/cloudflare/resources/abuse_reports/mitigations.py b/src/cloudflare/resources/abuse_reports/mitigations.py index f0714b399b2..7286fe6009b 100644 --- a/src/cloudflare/resources/abuse_reports/mitigations.py +++ b/src/cloudflare/resources/abuse_reports/mitigations.py @@ -50,7 +50,7 @@ def list( self, report_id: str, *, - account_id: str | None = None, + account_id: str, effective_after: str | Omit = omit, effective_before: str | Omit = omit, entity_type: Literal["url_pattern", "account", "zone"] | Omit = omit, @@ -115,8 +115,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_id: @@ -154,7 +152,7 @@ def review( self, report_id: str, *, - account_id: str | None = None, + account_id: str, appeals: Iterable[mitigation_review_params.Appeal], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -177,8 +175,6 @@ def review( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_id: @@ -223,7 +219,7 @@ def list( self, report_id: str, *, - account_id: str | None = None, + account_id: str, effective_after: str | Omit = omit, effective_before: str | Omit = omit, entity_type: Literal["url_pattern", "account", "zone"] | Omit = omit, @@ -288,8 +284,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_id: @@ -327,7 +321,7 @@ def review( self, report_id: str, *, - account_id: str | None = None, + account_id: str, appeals: Iterable[mitigation_review_params.Appeal], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -350,8 +344,6 @@ def review( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not report_id: diff --git a/src/cloudflare/resources/accounts/accounts.py b/src/cloudflare/resources/accounts/accounts.py index 301d01381e7..f4c7b48e77b 100644 --- a/src/cloudflare/resources/accounts/accounts.py +++ b/src/cloudflare/resources/accounts/accounts.py @@ -161,7 +161,7 @@ def create( def update( self, *, - account_id: str | None = None, + account_id: str, id: str, name: str, type: Literal["standard", "enterprise"], @@ -196,8 +196,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -280,7 +278,7 @@ def list( def delete( self, *, - account_id: str | None = None, + account_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, @@ -305,8 +303,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -324,7 +320,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -346,8 +342,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -457,7 +451,7 @@ async def create( async def update( self, *, - account_id: str | None = None, + account_id: str, id: str, name: str, type: Literal["standard", "enterprise"], @@ -492,8 +486,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -576,7 +568,7 @@ def list( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -601,8 +593,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -620,7 +610,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_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, @@ -642,8 +632,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/accounts/logs/audit.py b/src/cloudflare/resources/accounts/logs/audit.py index f059652a65e..8f5dbfeeac7 100644 --- a/src/cloudflare/resources/accounts/logs/audit.py +++ b/src/cloudflare/resources/accounts/logs/audit.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> AuditResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, before: Union[str, date], since: Union[str, date], id: audit_list_params.ID | Omit = omit, @@ -116,8 +116,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +186,7 @@ def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, before: Union[str, date], since: Union[str, date], id: audit_list_params.ID | Omit = omit, @@ -255,8 +253,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index f69d6eb0ef4..e6c71a43b57 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> MembersResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, email: str, roles: SequenceNotStr[str], status: Literal["accepted", "pending"] | Omit = omit, @@ -91,7 +91,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, email: str, policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy], status: Literal["accepted", "pending"] | Omit = omit, @@ -126,11 +126,11 @@ def create( """ ... - @required_args(["email", "roles"], ["email", "policies"]) + @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"]) def create( self, *, - account_id: str | None = None, + account_id: str, email: str, roles: SequenceNotStr[str] | Omit = omit, status: Literal["accepted", "pending"] | Omit = omit, @@ -142,8 +142,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -172,7 +170,7 @@ def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, roles: Iterable[Role] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -206,7 +204,7 @@ def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -235,11 +233,12 @@ def update( """ ... + @required_args(["account_id"], ["account_id", "policies"]) def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, roles: Iterable[Role] | Omit = omit, policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -249,8 +248,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -277,7 +274,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["user.first_name", "user.last_name", "user.email", "status"] | Omit = omit, page: float | Omit = omit, @@ -314,8 +311,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -344,7 +339,7 @@ def delete( self, member_id: str, *, - account_id: str | None = None, + account_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, @@ -368,8 +363,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -390,7 +383,7 @@ def get( self, member_id: str, *, - account_id: str | None = None, + account_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, @@ -414,8 +407,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -457,7 +448,7 @@ def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, email: str, roles: SequenceNotStr[str], status: Literal["accepted", "pending"] | Omit = omit, @@ -496,7 +487,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, email: str, policies: Iterable[member_create_params.IAMCreateMemberWithPoliciesPolicy], status: Literal["accepted", "pending"] | Omit = omit, @@ -531,11 +522,11 @@ async def create( """ ... - @required_args(["email", "roles"], ["email", "policies"]) + @required_args(["account_id", "email", "roles"], ["account_id", "email", "policies"]) async def create( self, *, - account_id: str | None = None, + account_id: str, email: str, roles: SequenceNotStr[str] | Omit = omit, status: Literal["accepted", "pending"] | Omit = omit, @@ -547,8 +538,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -577,7 +566,7 @@ async def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, roles: Iterable[Role] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -611,7 +600,7 @@ async def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -640,11 +629,12 @@ async def update( """ ... + @required_args(["account_id"], ["account_id", "policies"]) async def update( self, member_id: str, *, - account_id: str | None = None, + account_id: str, roles: Iterable[Role] | Omit = omit, policies: Iterable[member_update_params.IAMUpdateMemberWithPoliciesPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -654,8 +644,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Member]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -682,7 +670,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["user.first_name", "user.last_name", "user.email", "status"] | Omit = omit, page: float | Omit = omit, @@ -719,8 +707,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -749,7 +735,7 @@ async def delete( self, member_id: str, *, - account_id: str | None = None, + account_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, @@ -773,8 +759,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: @@ -795,7 +779,7 @@ async def get( self, member_id: str, *, - account_id: str | None = None, + account_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, @@ -819,8 +803,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not member_id: diff --git a/src/cloudflare/resources/accounts/roles.py b/src/cloudflare/resources/accounts/roles.py index fd478bef16d..ed81b0828d4 100644 --- a/src/cloudflare/resources/accounts/roles.py +++ b/src/cloudflare/resources/accounts/roles.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> RolesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -76,8 +76,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -103,7 +101,7 @@ def get( self, role_id: str, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not role_id: @@ -169,7 +165,7 @@ def with_streaming_response(self) -> AsyncRolesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -197,8 +193,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -224,7 +218,7 @@ async def get( self, role_id: str, *, - account_id: str | None = None, + account_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, @@ -248,8 +242,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not role_id: diff --git a/src/cloudflare/resources/accounts/subscriptions.py b/src/cloudflare/resources/accounts/subscriptions.py index 18c404d7ddd..60a993208f2 100644 --- a/src/cloudflare/resources/accounts/subscriptions.py +++ b/src/cloudflare/resources/accounts/subscriptions.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -106,7 +104,7 @@ def update( self, subscription_identifier: str, *, - account_id: str | None = None, + account_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -136,8 +134,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_identifier: @@ -171,7 +167,7 @@ def delete( self, subscription_identifier: str, *, - account_id: str | None = None, + account_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, @@ -195,8 +191,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_identifier: @@ -222,7 +216,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -244,8 +238,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -281,7 +273,7 @@ def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -309,8 +301,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -336,7 +326,7 @@ async def update( self, subscription_identifier: str, *, - account_id: str | None = None, + account_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -366,8 +356,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_identifier: @@ -401,7 +389,7 @@ async def delete( self, subscription_identifier: str, *, - account_id: str | None = None, + account_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, @@ -425,8 +413,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_identifier: @@ -452,7 +438,7 @@ async def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -474,8 +460,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/accounts/tokens/permission_groups.py b/src/cloudflare/resources/accounts/tokens/permission_groups.py index 459dc683be4..cd121b3d525 100644 --- a/src/cloudflare/resources/accounts/tokens/permission_groups.py +++ b/src/cloudflare/resources/accounts/tokens/permission_groups.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> PermissionGroupsResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -103,7 +101,7 @@ def list( def get( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -131,8 +129,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -178,7 +174,7 @@ def with_streaming_response(self) -> AsyncPermissionGroupsResourceWithStreamingR def list( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -206,8 +202,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -232,7 +226,7 @@ def list( async def get( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -260,8 +254,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/accounts/tokens/tokens.py b/src/cloudflare/resources/accounts/tokens/tokens.py index 5f65511d4c0..d96189242ab 100644 --- a/src/cloudflare/resources/accounts/tokens/tokens.py +++ b/src/cloudflare/resources/accounts/tokens/tokens.py @@ -78,7 +78,7 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, policies: Iterable[TokenPolicy], condition: token_create_params.Condition | Omit = omit, @@ -114,8 +114,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -144,7 +142,7 @@ def update( self, token_id: str, *, - account_id: str | None = None, + account_id: str, name: str, policies: Iterable[TokenPolicy], condition: token_update_params.Condition | Omit = omit, @@ -185,8 +183,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -217,7 +213,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -248,8 +244,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -276,7 +270,7 @@ def delete( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -300,8 +294,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -322,7 +314,7 @@ def get( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -346,8 +338,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -367,7 +357,7 @@ def get( def verify( self, *, - account_id: str | None = None, + account_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, @@ -389,8 +379,6 @@ def verify( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -437,7 +425,7 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, policies: Iterable[TokenPolicy], condition: token_create_params.Condition | Omit = omit, @@ -473,8 +461,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -503,7 +489,7 @@ async def update( self, token_id: str, *, - account_id: str | None = None, + account_id: str, name: str, policies: Iterable[TokenPolicy], condition: token_update_params.Condition | Omit = omit, @@ -544,8 +530,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -576,7 +560,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -607,8 +591,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -635,7 +617,7 @@ async def delete( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -659,8 +641,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -681,7 +661,7 @@ async def get( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -705,8 +685,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -726,7 +704,7 @@ async def get( async def verify( self, *, - account_id: str | None = None, + account_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, @@ -748,8 +726,6 @@ async def verify( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/accounts/tokens/value.py b/src/cloudflare/resources/accounts/tokens/value.py index 62cc5c437af..3c02046d4ff 100644 --- a/src/cloudflare/resources/accounts/tokens/value.py +++ b/src/cloudflare/resources/accounts/tokens/value.py @@ -48,7 +48,7 @@ def update( self, token_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,8 +73,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -117,7 +115,7 @@ async def update( self, token_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -142,8 +140,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: diff --git a/src/cloudflare/resources/acm/custom_trust_store.py b/src/cloudflare/resources/acm/custom_trust_store.py index 7f12f52a217..0f090a873c8 100644 --- a/src/cloudflare/resources/acm/custom_trust_store.py +++ b/src/cloudflare/resources/acm/custom_trust_store.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> CustomTrustStoreResourceWithStreamingRespon def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: 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. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -96,7 +94,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, page: float | Omit = omit, @@ -130,8 +128,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -159,7 +155,7 @@ def delete( self, custom_origin_trust_store_id: str, *, - zone_id: str | None = None, + 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, @@ -185,8 +181,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_origin_trust_store_id: @@ -213,7 +207,7 @@ def get( self, custom_origin_trust_store_id: str, *, - zone_id: str | None = None, + 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, @@ -238,8 +232,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_origin_trust_store_id: @@ -286,7 +278,7 @@ def with_streaming_response(self) -> AsyncCustomTrustStoreResourceWithStreamingR async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: 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. @@ -311,8 +303,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -333,7 +323,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, page: float | Omit = omit, @@ -367,8 +357,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -396,7 +384,7 @@ async def delete( self, custom_origin_trust_store_id: str, *, - zone_id: str | None = None, + 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, @@ -422,8 +410,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_origin_trust_store_id: @@ -450,7 +436,7 @@ async def get( self, custom_origin_trust_store_id: str, *, - zone_id: str | None = None, + 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, @@ -475,8 +461,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_origin_trust_store_id: diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py index 9fbe1565d77..0b99a4d2b11 100644 --- a/src/cloudflare/resources/acm/total_tls.py +++ b/src/cloudflare/resources/acm/total_tls.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> TotalTLSResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, certificate_authority: CertificateAuthority | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -105,7 +103,7 @@ def update( def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, certificate_authority: CertificateAuthority | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -134,8 +132,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -160,7 +156,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -182,8 +178,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -222,7 +216,7 @@ def with_streaming_response(self) -> AsyncTotalTLSResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, certificate_authority: CertificateAuthority | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -251,8 +245,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -277,7 +269,7 @@ async def update( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, certificate_authority: CertificateAuthority | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -306,8 +298,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -332,7 +322,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -354,8 +344,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/addressing/address_maps/accounts.py b/src/cloudflare/resources/addressing/address_maps/accounts.py index 001086dc20d..63365f5077d 100644 --- a/src/cloudflare/resources/addressing/address_maps/accounts.py +++ b/src/cloudflare/resources/addressing/address_maps/accounts.py @@ -46,7 +46,7 @@ def update( self, address_map_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -94,7 +92,7 @@ def delete( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -118,8 +116,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -161,7 +157,7 @@ async def update( self, address_map_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -186,8 +182,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -209,7 +203,7 @@ async def delete( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -233,8 +227,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: diff --git a/src/cloudflare/resources/addressing/address_maps/address_maps.py b/src/cloudflare/resources/addressing/address_maps/address_maps.py index 49378248039..6972bde802f 100644 --- a/src/cloudflare/resources/addressing/address_maps/address_maps.py +++ b/src/cloudflare/resources/addressing/address_maps/address_maps.py @@ -87,7 +87,7 @@ def with_streaming_response(self) -> AddressMapsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, enabled: Optional[bool] | Omit = omit, ips: SequenceNotStr[str] | Omit = omit, @@ -122,8 +122,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -150,7 +148,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -172,8 +170,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -189,7 +185,7 @@ def delete( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -215,8 +211,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -237,7 +231,7 @@ def edit( self, address_map_id: str, *, - account_id: str | None = None, + account_id: str, default_sni: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, enabled: Optional[bool] | Omit = omit, @@ -276,8 +270,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -310,7 +302,7 @@ def get( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -334,8 +326,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -392,7 +382,7 @@ def with_streaming_response(self) -> AsyncAddressMapsResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, enabled: Optional[bool] | Omit = omit, ips: SequenceNotStr[str] | Omit = omit, @@ -427,8 +417,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -455,7 +443,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -477,8 +465,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -494,7 +480,7 @@ async def delete( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -520,8 +506,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -542,7 +526,7 @@ async def edit( self, address_map_id: str, *, - account_id: str | None = None, + account_id: str, default_sni: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, enabled: Optional[bool] | Omit = omit, @@ -581,8 +565,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -615,7 +597,7 @@ async def get( self, address_map_id: str, *, - account_id: str | None = None, + account_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, @@ -639,8 +621,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: diff --git a/src/cloudflare/resources/addressing/address_maps/ips.py b/src/cloudflare/resources/addressing/address_maps/ips.py index dfa69fd5403..5fda1d42439 100644 --- a/src/cloudflare/resources/addressing/address_maps/ips.py +++ b/src/cloudflare/resources/addressing/address_maps/ips.py @@ -46,7 +46,7 @@ def update( self, ip_address: str, *, - account_id: str | None = None, + account_id: str, address_map_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -74,8 +74,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -100,7 +98,7 @@ def delete( self, ip_address: str, *, - account_id: str | None = None, + account_id: str, address_map_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. @@ -127,8 +125,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -173,7 +169,7 @@ async def update( self, ip_address: str, *, - account_id: str | None = None, + account_id: str, address_map_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -201,8 +197,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -227,7 +221,7 @@ async def delete( self, ip_address: str, *, - account_id: str | None = None, + account_id: str, address_map_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. @@ -254,8 +248,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: diff --git a/src/cloudflare/resources/addressing/address_maps/zones.py b/src/cloudflare/resources/addressing/address_maps/zones.py index a1d6df21295..83d6b99ca04 100644 --- a/src/cloudflare/resources/addressing/address_maps/zones.py +++ b/src/cloudflare/resources/addressing/address_maps/zones.py @@ -46,8 +46,8 @@ def update( self, address_map_id: str, *, - zone_id: str | None = None, - account_id: str | None = None, + zone_id: str, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,12 +74,8 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -102,8 +98,8 @@ def delete( self, address_map_id: str, *, - zone_id: str | None = None, - account_id: str | None = None, + zone_id: str, + account_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, @@ -129,12 +125,8 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -177,8 +169,8 @@ async def update( self, address_map_id: str, *, - zone_id: str | None = None, - account_id: str | None = None, + zone_id: str, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -205,12 +197,8 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: @@ -233,8 +221,8 @@ async def delete( self, address_map_id: str, *, - zone_id: str | None = None, - account_id: str | None = None, + zone_id: str, + account_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, @@ -260,12 +248,8 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_map_id: diff --git a/src/cloudflare/resources/addressing/loa_documents.py b/src/cloudflare/resources/addressing/loa_documents.py index f2d4bfb9db9..8c57a59d2c0 100644 --- a/src/cloudflare/resources/addressing/loa_documents.py +++ b/src/cloudflare/resources/addressing/loa_documents.py @@ -55,7 +55,7 @@ def with_streaming_response(self) -> LOADocumentsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, loa_document: 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. @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be @@ -105,7 +103,7 @@ def get( self, loa_document_id: str, *, - account_id: str | None = None, + account_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, @@ -129,8 +127,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not loa_document_id: @@ -172,7 +168,7 @@ def with_streaming_response(self) -> AsyncLOADocumentsResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, loa_document: 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. @@ -197,8 +193,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be @@ -224,7 +218,7 @@ async def get( self, loa_document_id: str, *, - account_id: str | None = None, + account_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, @@ -248,8 +242,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not loa_document_id: diff --git a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py index 4f5b488c4f7..2e89a5cbc75 100644 --- a/src/cloudflare/resources/addressing/prefixes/advertisement_status.py +++ b/src/cloudflare/resources/addressing/prefixes/advertisement_status.py @@ -51,7 +51,7 @@ def edit( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, advertised: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -82,8 +82,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -114,7 +112,7 @@ def get( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -141,8 +139,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -189,7 +185,7 @@ async def edit( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, advertised: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -220,8 +216,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -252,7 +246,7 @@ async def get( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -279,8 +273,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: diff --git a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py index 388ac2ec2de..b971dbbd78e 100644 --- a/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/bgp_prefixes.py @@ -49,7 +49,7 @@ def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: 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. @@ -78,8 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -105,7 +103,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -133,8 +131,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -156,7 +152,7 @@ def edit( self, bgp_prefix_id: str, *, - account_id: str | None = None, + account_id: str, prefix_id: str, asn_prepend_count: int | Omit = omit, auto_advertise_withdraw: bool | Omit = omit, @@ -194,8 +190,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -231,7 +225,7 @@ def get( self, bgp_prefix_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -258,8 +252,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -308,7 +300,7 @@ async def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: 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. @@ -337,8 +329,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -364,7 +354,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -392,8 +382,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -415,7 +403,7 @@ async def edit( self, bgp_prefix_id: str, *, - account_id: str | None = None, + account_id: str, prefix_id: str, asn_prepend_count: int | Omit = omit, auto_advertise_withdraw: bool | Omit = omit, @@ -453,8 +441,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -490,7 +476,7 @@ async def get( self, bgp_prefix_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -517,8 +503,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: diff --git a/src/cloudflare/resources/addressing/prefixes/delegations.py b/src/cloudflare/resources/addressing/prefixes/delegations.py index bbaec487686..f77cf6833b3 100644 --- a/src/cloudflare/resources/addressing/prefixes/delegations.py +++ b/src/cloudflare/resources/addressing/prefixes/delegations.py @@ -50,7 +50,7 @@ def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: str, delegated_account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -113,7 +111,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -137,8 +135,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -160,7 +156,7 @@ def delete( self, delegation_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -187,8 +183,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -237,7 +231,7 @@ async def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: str, delegated_account_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -267,8 +261,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -300,7 +292,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -324,8 +316,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -347,7 +337,7 @@ async def delete( self, delegation_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -374,8 +364,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: diff --git a/src/cloudflare/resources/addressing/prefixes/prefixes.py b/src/cloudflare/resources/addressing/prefixes/prefixes.py index 60cf4c0a008..34d886a30f0 100644 --- a/src/cloudflare/resources/addressing/prefixes/prefixes.py +++ b/src/cloudflare/resources/addressing/prefixes/prefixes.py @@ -97,7 +97,7 @@ def with_streaming_response(self) -> PrefixesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, asn: int, cidr: str, delegate_loa_creation: bool | Omit = omit, @@ -135,8 +135,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -164,7 +162,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -186,8 +184,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -203,7 +199,7 @@ def delete( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -227,8 +223,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -247,7 +241,7 @@ def edit( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, description: 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. @@ -274,8 +268,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -299,7 +291,7 @@ def get( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -323,8 +315,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -383,7 +373,7 @@ def with_streaming_response(self) -> AsyncPrefixesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, asn: int, cidr: str, delegate_loa_creation: bool | Omit = omit, @@ -421,8 +411,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -450,7 +438,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -472,8 +460,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -489,7 +475,7 @@ async def delete( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -513,8 +499,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -533,7 +517,7 @@ async def edit( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, description: 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. @@ -560,8 +544,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -585,7 +567,7 @@ async def get( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -609,8 +591,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: diff --git a/src/cloudflare/resources/addressing/prefixes/service_bindings.py b/src/cloudflare/resources/addressing/prefixes/service_bindings.py index d8e617cc87e..f1fb2483c39 100644 --- a/src/cloudflare/resources/addressing/prefixes/service_bindings.py +++ b/src/cloudflare/resources/addressing/prefixes/service_bindings.py @@ -50,7 +50,7 @@ def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: str, service_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -119,7 +117,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -149,8 +147,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -172,7 +168,7 @@ def delete( self, binding_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -199,8 +195,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -224,7 +218,7 @@ def get( self, binding_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -251,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -301,7 +293,7 @@ async def create( self, prefix_id: str, *, - account_id: str | None = None, + account_id: str, cidr: str, service_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -337,8 +329,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -370,7 +360,7 @@ def list( self, prefix_id: str, *, - account_id: str | None = None, + account_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, @@ -400,8 +390,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -423,7 +411,7 @@ async def delete( self, binding_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -450,8 +438,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: @@ -475,7 +461,7 @@ async def get( self, binding_id: str, *, - account_id: str | None = None, + account_id: str, prefix_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. @@ -502,8 +488,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not prefix_id: diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py index 5bee3bcf4f7..7145a5da939 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regional_hostnames.py @@ -64,7 +64,7 @@ def with_streaming_response(self) -> RegionalHostnamesResourceWithStreamingRespo def create( self, *, - zone_id: str | None = None, + zone_id: str, hostname: str, region_key: str, routing: str | Omit = omit, @@ -100,8 +100,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -127,7 +125,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -149,8 +147,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -166,7 +162,7 @@ def delete( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -191,8 +187,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -211,7 +205,7 @@ def edit( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, region_key: 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. @@ -241,8 +235,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -266,7 +258,7 @@ def get( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -291,8 +283,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -339,7 +329,7 @@ def with_streaming_response(self) -> AsyncRegionalHostnamesResourceWithStreaming async def create( self, *, - zone_id: str | None = None, + zone_id: str, hostname: str, region_key: str, routing: str | Omit = omit, @@ -375,8 +365,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -402,7 +390,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -424,8 +412,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -441,7 +427,7 @@ async def delete( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -466,8 +452,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -486,7 +470,7 @@ async def edit( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, region_key: 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. @@ -516,8 +500,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -543,7 +525,7 @@ async def get( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -568,8 +550,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: diff --git a/src/cloudflare/resources/addressing/regional_hostnames/regions.py b/src/cloudflare/resources/addressing/regional_hostnames/regions.py index a9d0344c3ed..ec9ea7806d7 100644 --- a/src/cloudflare/resources/addressing/regional_hostnames/regions.py +++ b/src/cloudflare/resources/addressing/regional_hostnames/regions.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> RegionsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -66,8 +66,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -103,7 +101,7 @@ def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/addressing/services.py b/src/cloudflare/resources/addressing/services.py index 9dff6ddfedf..5eb22d7ba77 100644 --- a/src/cloudflare/resources/addressing/services.py +++ b/src/cloudflare/resources/addressing/services.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -106,7 +104,7 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -131,8 +129,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 2591ae29f5f..0e953643619 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -137,7 +137,7 @@ def with_streaming_response(self) -> AIGatewayResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, cache_invalidate_on_update: bool, cache_ttl: Optional[int], @@ -185,8 +185,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -227,7 +225,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, cache_invalidate_on_update: bool, cache_ttl: Optional[int], collect_logs: bool, @@ -278,8 +276,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -324,7 +320,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -349,8 +345,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -377,7 +371,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -399,8 +393,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -421,7 +413,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_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, @@ -443,8 +435,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -513,7 +503,7 @@ def with_streaming_response(self) -> AsyncAIGatewayResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, cache_invalidate_on_update: bool, cache_ttl: Optional[int], @@ -561,8 +551,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -603,7 +591,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, cache_invalidate_on_update: bool, cache_ttl: Optional[int], collect_logs: bool, @@ -654,8 +642,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -700,7 +686,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -725,8 +711,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -753,7 +737,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -775,8 +759,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -797,7 +779,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_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, @@ -819,8 +801,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index 1088fe9c208..d7b8a6d63ce 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -53,7 +53,7 @@ def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, enable: bool, filters: Iterable[dataset_create_params.Filter], name: str, @@ -78,8 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -112,7 +110,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, enable: bool, filters: Iterable[dataset_update_params.Filter], @@ -138,8 +136,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -175,7 +171,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, enable: bool | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, @@ -204,8 +200,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -240,7 +234,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -263,8 +257,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -292,7 +284,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -315,8 +307,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -365,7 +355,7 @@ async def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, enable: bool, filters: Iterable[dataset_create_params.Filter], name: str, @@ -390,8 +380,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -424,7 +412,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, enable: bool, filters: Iterable[dataset_update_params.Filter], @@ -450,8 +438,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -487,7 +473,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, enable: bool | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, @@ -516,8 +502,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -552,7 +536,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -575,8 +559,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -604,7 +586,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -627,8 +609,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/ai_gateway/dynamic_routing.py b/src/cloudflare/resources/ai_gateway/dynamic_routing.py index 3268cf04ed1..db31f826da1 100644 --- a/src/cloudflare/resources/ai_gateway/dynamic_routing.py +++ b/src/cloudflare/resources/ai_gateway/dynamic_routing.py @@ -62,7 +62,7 @@ def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, elements: Iterable[dynamic_routing_create_params.Element], name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -117,7 +115,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -139,8 +137,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -165,7 +161,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_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, @@ -185,8 +181,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -207,7 +201,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -228,8 +222,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -257,7 +249,7 @@ def create_deployment( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, version_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -279,8 +271,6 @@ def create_deployment( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -314,7 +304,7 @@ def create_version( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, elements: Iterable[dynamic_routing_create_version_params.Element], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -336,8 +326,6 @@ def create_version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -368,7 +356,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -389,8 +377,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -418,7 +404,7 @@ def get_version( self, version_id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -440,8 +426,6 @@ def get_version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -472,7 +456,7 @@ def list_deployments( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -493,8 +477,6 @@ def list_deployments( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -518,7 +500,7 @@ def list_versions( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -539,8 +521,6 @@ def list_versions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -585,7 +565,7 @@ async def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, elements: Iterable[dynamic_routing_create_params.Element], name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -607,8 +587,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -640,7 +618,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -662,8 +640,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -688,7 +664,7 @@ async def list( self, gateway_id: str, *, - account_id: str | None = None, + account_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, @@ -708,8 +684,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -730,7 +704,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -751,8 +725,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -780,7 +752,7 @@ async def create_deployment( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, version_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -802,8 +774,6 @@ async def create_deployment( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -837,7 +807,7 @@ async def create_version( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, elements: Iterable[dynamic_routing_create_version_params.Element], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -859,8 +829,6 @@ async def create_version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -891,7 +859,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -912,8 +880,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -941,7 +907,7 @@ async def get_version( self, version_id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -963,8 +929,6 @@ async def get_version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -995,7 +959,7 @@ async def list_deployments( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -1016,8 +980,6 @@ async def list_deployments( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -1041,7 +1003,7 @@ async def list_versions( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -1062,8 +1024,6 @@ async def list_versions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/ai_gateway/evaluation_types.py b/src/cloudflare/resources/ai_gateway/evaluation_types.py index 17be00d592a..16124fb51bd 100644 --- a/src/cloudflare/resources/ai_gateway/evaluation_types.py +++ b/src/cloudflare/resources/ai_gateway/evaluation_types.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> EvaluationTypesResourceWithStreamingRespons def list( self, *, - account_id: str | None = None, + account_id: str, order_by: str | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, @@ -71,8 +71,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -120,7 +118,7 @@ def with_streaming_response(self) -> AsyncEvaluationTypesResourceWithStreamingRe def list( self, *, - account_id: str | None = None, + account_id: str, order_by: str | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, @@ -144,8 +142,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index 26b1497345b..8a956f827b2 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -52,7 +52,7 @@ def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str], evaluation_type_ids: SequenceNotStr[str], name: str, @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -111,7 +109,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -140,8 +138,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -176,7 +172,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -199,8 +195,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -228,7 +222,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -251,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -301,7 +293,7 @@ async def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str], evaluation_type_ids: SequenceNotStr[str], name: str, @@ -326,8 +318,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -360,7 +350,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -389,8 +379,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -425,7 +413,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -448,8 +436,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -477,7 +463,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -500,8 +486,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py index 32c18a9f5f4..a9078f926ce 100644 --- a/src/cloudflare/resources/ai_gateway/logs.py +++ b/src/cloudflare/resources/ai_gateway/logs.py @@ -53,7 +53,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, cached: bool | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, @@ -103,8 +103,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -162,7 +160,7 @@ def delete( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, filters: Iterable[log_delete_params.Filter] | Omit = omit, limit: int | Omit = omit, order_by: Literal[ @@ -201,8 +199,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -235,7 +231,7 @@ def edit( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, feedback: Optional[float] | Omit = omit, metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit, @@ -261,8 +257,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -298,7 +292,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -321,8 +315,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -350,7 +342,7 @@ def request( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -373,8 +365,6 @@ def request( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -398,7 +388,7 @@ def response( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -421,8 +411,6 @@ def response( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -467,7 +455,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, cached: bool | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, end_date: Union[str, datetime] | Omit = omit, @@ -517,8 +505,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -576,7 +562,7 @@ async def delete( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, filters: Iterable[log_delete_params.Filter] | Omit = omit, limit: int | Omit = omit, order_by: Literal[ @@ -615,8 +601,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -649,7 +633,7 @@ async def edit( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_id: str, feedback: Optional[float] | Omit = omit, metadata: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit, @@ -675,8 +659,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -712,7 +694,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -735,8 +717,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -764,7 +744,7 @@ async def request( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -787,8 +767,6 @@ async def request( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -812,7 +790,7 @@ async def response( self, id: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -835,8 +813,6 @@ async def response( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/ai_gateway/provider_configs.py b/src/cloudflare/resources/ai_gateway/provider_configs.py index c0af4ebe77a..a78fb449c59 100644 --- a/src/cloudflare/resources/ai_gateway/provider_configs.py +++ b/src/cloudflare/resources/ai_gateway/provider_configs.py @@ -50,7 +50,7 @@ def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, alias: str, default_config: bool, provider_slug: str, @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -117,7 +115,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -141,8 +139,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -195,7 +191,7 @@ async def create( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, alias: str, default_config: bool, provider_slug: str, @@ -224,8 +220,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -262,7 +256,7 @@ def list( self, gateway_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -286,8 +280,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/ai_gateway/urls.py b/src/cloudflare/resources/ai_gateway/urls.py index 50c6c57c708..f4a834510b1 100644 --- a/src/cloudflare/resources/ai_gateway/urls.py +++ b/src/cloudflare/resources/ai_gateway/urls.py @@ -47,7 +47,7 @@ def get( self, provider: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -70,8 +70,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: @@ -120,7 +118,7 @@ async def get( self, provider: str, *, - account_id: str | None = None, + account_id: str, gateway_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. @@ -143,8 +141,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gateway_id: diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index 1f033a72cbc..44e302e2e3e 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -74,7 +74,7 @@ def with_streaming_response(self) -> InstancesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -215,8 +215,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -268,7 +266,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ Literal[ @@ -443,8 +441,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -499,7 +495,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, namespace: Optional[str] | Omit = omit, order_by: Literal["created_at"] | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, @@ -531,8 +527,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -562,7 +556,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -585,8 +579,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -607,7 +599,7 @@ def chat_completions( self, id: str, *, - account_id: str | None = None, + account_id: str, messages: Iterable[instance_chat_completions_params.Message], aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, model: Literal[ @@ -666,8 +658,6 @@ def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -695,7 +685,7 @@ def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -718,8 +708,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -740,7 +728,7 @@ def search( self, id: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: instance_search_params.AISearchOptions | Omit = omit, messages: Iterable[instance_search_params.Message] | Omit = omit, query: str | Omit = omit, @@ -769,8 +757,6 @@ def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -799,7 +785,7 @@ def stats( self, id: str, *, - account_id: str | None = None, + account_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, @@ -821,8 +807,6 @@ def stats( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -867,7 +851,7 @@ def with_streaming_response(self) -> AsyncInstancesResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -1008,8 +992,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -1061,7 +1043,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ Literal[ @@ -1236,8 +1218,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -1292,7 +1272,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, namespace: Optional[str] | Omit = omit, order_by: Literal["created_at"] | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, @@ -1324,8 +1304,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -1355,7 +1333,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -1378,8 +1356,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -1400,7 +1376,7 @@ async def chat_completions( self, id: str, *, - account_id: str | None = None, + account_id: str, messages: Iterable[instance_chat_completions_params.Message], aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, model: Literal[ @@ -1459,8 +1435,6 @@ async def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -1488,7 +1462,7 @@ async def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -1511,8 +1485,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -1533,7 +1505,7 @@ async def search( self, id: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: instance_search_params.AISearchOptions | Omit = omit, messages: Iterable[instance_search_params.Message] | Omit = omit, query: str | Omit = omit, @@ -1562,8 +1534,6 @@ async def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -1592,7 +1562,7 @@ async def stats( self, id: str, *, - account_id: str | None = None, + account_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, @@ -1614,8 +1584,6 @@ async def stats( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/aisearch/instances/jobs.py b/src/cloudflare/resources/aisearch/instances/jobs.py index f7c31e7d100..e53d8076a5a 100644 --- a/src/cloudflare/resources/aisearch/instances/jobs.py +++ b/src/cloudflare/resources/aisearch/instances/jobs.py @@ -52,7 +52,7 @@ def create( self, id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -98,7 +96,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -122,8 +120,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -151,7 +147,7 @@ def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, 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. @@ -174,8 +170,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -203,7 +197,7 @@ def logs( self, job_id: str, *, - account_id: str | None = None, + account_id: str, id: str, page: int | Omit = omit, per_page: int | Omit = omit, @@ -228,8 +222,6 @@ def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -285,7 +277,7 @@ async def create( self, id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -308,8 +300,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -331,7 +321,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -355,8 +345,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -384,7 +372,7 @@ async def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, 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. @@ -407,8 +395,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -436,7 +422,7 @@ async def logs( self, job_id: str, *, - account_id: str | None = None, + account_id: str, id: str, page: int | Omit = omit, per_page: int | Omit = omit, @@ -461,8 +447,6 @@ async def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/instances.py b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py index 3a08044deed..8618c213255 100644 --- a/src/cloudflare/resources/aisearch/namespaces/instances/instances.py +++ b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py @@ -87,7 +87,7 @@ def create( self, name: str, *, - account_id: str | None = None, + account_id: str, id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -228,8 +228,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -285,7 +283,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -461,8 +459,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -525,7 +521,7 @@ def list( self, name: str, *, - account_id: str | None = None, + account_id: str, namespace: Optional[str] | Omit = omit, order_by: Literal["created_at"] | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, @@ -557,8 +553,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -592,7 +586,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -616,8 +610,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -645,7 +637,7 @@ def chat_completions( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, messages: Iterable[instance_chat_completions_params.Message], aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, @@ -705,8 +697,6 @@ def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -739,7 +729,7 @@ def read( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -763,8 +753,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -792,7 +780,7 @@ def search( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, aisearch_options: instance_search_params.AISearchOptions | Omit = omit, messages: Iterable[instance_search_params.Message] | Omit = omit, @@ -822,8 +810,6 @@ def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -859,7 +845,7 @@ def stats( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -882,8 +868,6 @@ def stats( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -940,7 +924,7 @@ async def create( self, name: str, *, - account_id: str | None = None, + account_id: str, id: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -1081,8 +1065,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1138,7 +1120,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Optional[ @@ -1314,8 +1296,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1378,7 +1358,7 @@ def list( self, name: str, *, - account_id: str | None = None, + account_id: str, namespace: Optional[str] | Omit = omit, order_by: Literal["created_at"] | Omit = omit, order_by_direction: Literal["asc", "desc"] | Omit = omit, @@ -1410,8 +1390,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1445,7 +1423,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -1469,8 +1447,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1498,7 +1474,7 @@ async def chat_completions( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, messages: Iterable[instance_chat_completions_params.Message], aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, @@ -1558,8 +1534,6 @@ async def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1592,7 +1566,7 @@ async def read( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -1616,8 +1590,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1645,7 +1617,7 @@ async def search( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, aisearch_options: instance_search_params.AISearchOptions | Omit = omit, messages: Iterable[instance_search_params.Message] | Omit = omit, @@ -1675,8 +1647,6 @@ async def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1712,7 +1682,7 @@ async def stats( self, id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -1735,8 +1705,6 @@ async def stats( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/items.py b/src/cloudflare/resources/aisearch/namespaces/instances/items.py index 1fecc1e6539..ecd58bba6a1 100644 --- a/src/cloudflare/resources/aisearch/namespaces/instances/items.py +++ b/src/cloudflare/resources/aisearch/namespaces/instances/items.py @@ -72,7 +72,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, item_id: str | Omit = omit, metadata_filter: str | Omit = omit, @@ -118,8 +118,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -160,7 +158,7 @@ def delete( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -184,8 +182,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -216,7 +212,7 @@ def chunks( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, limit: int | Omit = omit, @@ -243,8 +239,6 @@ def chunks( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -282,7 +276,7 @@ def create_or_update( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, key: str, next_action: Literal["INDEX"], @@ -309,8 +303,6 @@ def create_or_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -345,7 +337,7 @@ def download( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -370,8 +362,6 @@ def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -399,7 +389,7 @@ def get( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -423,8 +413,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -455,7 +443,7 @@ def logs( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, cursor: str | Omit = omit, @@ -481,8 +469,6 @@ def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -520,7 +506,7 @@ def sync( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, next_action: Literal["INDEX"], @@ -546,8 +532,6 @@ def sync( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -579,7 +563,7 @@ def upload( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, file: item_upload_params.File, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -604,8 +588,6 @@ def upload( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -662,7 +644,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, item_id: str | Omit = omit, metadata_filter: str | Omit = omit, @@ -708,8 +690,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -750,7 +730,7 @@ async def delete( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -774,8 +754,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -806,7 +784,7 @@ async def chunks( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, limit: int | Omit = omit, @@ -833,8 +811,6 @@ async def chunks( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -872,7 +848,7 @@ async def create_or_update( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, key: str, next_action: Literal["INDEX"], @@ -899,8 +875,6 @@ async def create_or_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -935,7 +909,7 @@ async def download( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -960,8 +934,6 @@ async def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -989,7 +961,7 @@ async def get( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1013,8 +985,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1045,7 +1015,7 @@ async def logs( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, cursor: str | Omit = omit, @@ -1071,8 +1041,6 @@ async def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1110,7 +1078,7 @@ async def sync( self, item_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, next_action: Literal["INDEX"], @@ -1136,8 +1104,6 @@ async def sync( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -1169,7 +1135,7 @@ async def upload( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, file: item_upload_params.File, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1194,8 +1160,6 @@ async def upload( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py b/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py index a6e4af5bdbf..b549f387058 100644 --- a/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py +++ b/src/cloudflare/resources/aisearch/namespaces/instances/jobs.py @@ -59,7 +59,7 @@ def create( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -113,7 +111,7 @@ def update( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, action: Literal["cancel"], @@ -138,8 +136,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -171,7 +167,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, page: int | Omit = omit, per_page: int | Omit = omit, @@ -196,8 +192,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -232,7 +226,7 @@ def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -256,8 +250,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -288,7 +280,7 @@ def logs( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, page: int | Omit = omit, @@ -314,8 +306,6 @@ def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -374,7 +364,7 @@ async def create( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -398,8 +388,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -428,7 +416,7 @@ async def update( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, action: Literal["cancel"], @@ -453,8 +441,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -486,7 +472,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, name: str, page: int | Omit = omit, per_page: int | Omit = omit, @@ -511,8 +497,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -547,7 +531,7 @@ async def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -571,8 +555,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -603,7 +585,7 @@ async def logs( self, job_id: str, *, - account_id: str | None = None, + account_id: str, name: str, id: str, page: int | Omit = omit, @@ -629,8 +611,6 @@ async def logs( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: diff --git a/src/cloudflare/resources/aisearch/namespaces/namespaces.py b/src/cloudflare/resources/aisearch/namespaces/namespaces.py index 152664c1ecc..9b8900fb9fb 100644 --- a/src/cloudflare/resources/aisearch/namespaces/namespaces.py +++ b/src/cloudflare/resources/aisearch/namespaces/namespaces.py @@ -72,7 +72,7 @@ def with_streaming_response(self) -> NamespacesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -123,7 +121,7 @@ def update( self, name: str, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -147,8 +145,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -169,7 +165,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -199,8 +195,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -227,7 +221,7 @@ def delete( self, name: str, *, - account_id: str | None = None, + account_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, @@ -247,8 +241,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -269,7 +261,7 @@ def chat_completions( self, name: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: namespace_chat_completions_params.AISearchOptions, messages: Iterable[namespace_chat_completions_params.Message], model: Literal[ @@ -326,8 +318,6 @@ def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -355,7 +345,7 @@ def read( self, name: str, *, - account_id: str | None = None, + account_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, @@ -375,8 +365,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -397,7 +385,7 @@ def search( self, name: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: namespace_search_params.AISearchOptions, messages: Iterable[namespace_search_params.Message] | Omit = omit, query: str | Omit = omit, @@ -424,8 +412,6 @@ def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -480,7 +466,7 @@ def with_streaming_response(self) -> AsyncNamespacesResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -504,8 +490,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -531,7 +515,7 @@ async def update( self, name: str, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -555,8 +539,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -579,7 +561,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -609,8 +591,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -637,7 +617,7 @@ async def delete( self, name: str, *, - account_id: str | None = None, + account_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, @@ -657,8 +637,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -679,7 +657,7 @@ async def chat_completions( self, name: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: namespace_chat_completions_params.AISearchOptions, messages: Iterable[namespace_chat_completions_params.Message], model: Literal[ @@ -736,8 +714,6 @@ async def chat_completions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -765,7 +741,7 @@ async def read( self, name: str, *, - account_id: str | None = None, + account_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, @@ -785,8 +761,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: @@ -807,7 +781,7 @@ async def search( self, name: str, *, - account_id: str | None = None, + account_id: str, aisearch_options: namespace_search_params.AISearchOptions, messages: Iterable[namespace_search_params.Message] | Omit = omit, query: str | Omit = omit, @@ -834,8 +808,6 @@ async def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not name: diff --git a/src/cloudflare/resources/aisearch/tokens.py b/src/cloudflare/resources/aisearch/tokens.py index d0e62908a9e..e1a7f70750c 100644 --- a/src/cloudflare/resources/aisearch/tokens.py +++ b/src/cloudflare/resources/aisearch/tokens.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, cf_api_id: str, cf_api_key: str, name: str, @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -104,7 +102,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, cf_api_id: str, cf_api_key: str, name: str, @@ -128,8 +126,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -158,7 +154,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -187,8 +183,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -215,7 +209,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -235,8 +229,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -257,7 +249,7 @@ def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -277,8 +269,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -319,7 +309,7 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, cf_api_id: str, cf_api_key: str, name: str, @@ -343,8 +333,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -372,7 +360,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, cf_api_id: str, cf_api_key: str, name: str, @@ -396,8 +384,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -426,7 +412,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -455,8 +441,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -483,7 +467,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -503,8 +487,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -525,7 +507,7 @@ async def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -545,8 +527,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/alerting/available_alerts.py b/src/cloudflare/resources/alerting/available_alerts.py index d22e4276984..a8cbe10fd3a 100644 --- a/src/cloudflare/resources/alerting/available_alerts.py +++ b/src/cloudflare/resources/alerting/available_alerts.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> AvailableAlertsResourceWithStreamingRespons def list( self, *, - account_id: str | None = None, + account_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, @@ -68,8 +68,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncAvailableAlertsResourceWithStreamingRe async def list( self, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/alerting/destinations/eligible.py b/src/cloudflare/resources/alerting/destinations/eligible.py index e558be8c41b..b00a0e8c482 100644 --- a/src/cloudflare/resources/alerting/destinations/eligible.py +++ b/src/cloudflare/resources/alerting/destinations/eligible.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> EligibleResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncEligibleResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/alerting/destinations/pagerduty.py b/src/cloudflare/resources/alerting/destinations/pagerduty.py index 5b3f7ee970d..49c253762a9 100644 --- a/src/cloudflare/resources/alerting/destinations/pagerduty.py +++ b/src/cloudflare/resources/alerting/destinations/pagerduty.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> PagerdutyResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_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, @@ -72,8 +72,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -91,7 +89,7 @@ def create( def delete( self, *, - account_id: str | None = None, + account_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, @@ -113,8 +111,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -128,7 +124,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -150,8 +146,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -167,7 +161,7 @@ def link( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -191,8 +185,6 @@ def link( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: @@ -237,7 +229,7 @@ def with_streaming_response(self) -> AsyncPagerdutyResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_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, @@ -259,8 +251,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -278,7 +268,7 @@ async def create( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -300,8 +290,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -315,7 +303,7 @@ async def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -337,8 +325,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -354,7 +340,7 @@ async def link( self, token_id: str, *, - account_id: str | None = None, + account_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, @@ -378,8 +364,6 @@ async def link( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not token_id: diff --git a/src/cloudflare/resources/alerting/destinations/webhooks.py b/src/cloudflare/resources/alerting/destinations/webhooks.py index e17a3c8f40c..fd2c030e9ae 100644 --- a/src/cloudflare/resources/alerting/destinations/webhooks.py +++ b/src/cloudflare/resources/alerting/destinations/webhooks.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> WebhooksResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, url: str, secret: str | Omit = omit, @@ -85,8 +85,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -113,7 +111,7 @@ def update( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, name: str, url: str, secret: str | Omit = omit, @@ -149,8 +147,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: @@ -182,7 +178,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -204,8 +200,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -221,7 +215,7 @@ def delete( self, webhook_id: str, *, - account_id: str | None = None, + account_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, @@ -245,8 +239,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: @@ -267,7 +259,7 @@ def get( self, webhook_id: str, *, - account_id: str | None = None, + account_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, @@ -291,8 +283,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: @@ -337,7 +327,7 @@ def with_streaming_response(self) -> AsyncWebhooksResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, url: str, secret: str | Omit = omit, @@ -371,8 +361,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -399,7 +387,7 @@ async def update( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, name: str, url: str, secret: str | Omit = omit, @@ -435,8 +423,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: @@ -468,7 +454,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -490,8 +476,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -507,7 +491,7 @@ async def delete( self, webhook_id: str, *, - account_id: str | None = None, + account_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, @@ -531,8 +515,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: @@ -553,7 +535,7 @@ async def get( self, webhook_id: str, *, - account_id: str | None = None, + account_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, @@ -577,8 +559,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not webhook_id: diff --git a/src/cloudflare/resources/alerting/history.py b/src/cloudflare/resources/alerting/history.py index a62916b993d..a9673e39882 100644 --- a/src/cloudflare/resources/alerting/history.py +++ b/src/cloudflare/resources/alerting/history.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, before: Union[str, datetime] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -87,8 +87,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -136,7 +134,7 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, before: Union[str, datetime] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -175,8 +173,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/alerting/policies.py b/src/cloudflare/resources/alerting/policies.py index 28e50d93869..e47e67cd5a8 100644 --- a/src/cloudflare/resources/alerting/policies.py +++ b/src/cloudflare/resources/alerting/policies.py @@ -54,7 +54,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, alert_type: Literal[ "abuse_report_alert", "access_custom_certificate_expiration_type", @@ -173,8 +173,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -205,7 +203,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, alert_interval: str | Omit = omit, alert_type: Literal[ "abuse_report_alert", @@ -327,8 +325,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -362,7 +358,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -384,8 +380,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -401,7 +395,7 @@ def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -425,8 +419,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -445,7 +437,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -469,8 +461,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -513,7 +503,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, alert_type: Literal[ "abuse_report_alert", "access_custom_certificate_expiration_type", @@ -632,8 +622,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -664,7 +652,7 @@ async def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, alert_interval: str | Omit = omit, alert_type: Literal[ "abuse_report_alert", @@ -786,8 +774,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -821,7 +807,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -843,8 +829,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -860,7 +844,7 @@ async def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -884,8 +868,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -904,7 +886,7 @@ async def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -928,8 +910,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/alerting/silences.py b/src/cloudflare/resources/alerting/silences.py index 34f364ab0a4..61acc13a54b 100644 --- a/src/cloudflare/resources/alerting/silences.py +++ b/src/cloudflare/resources/alerting/silences.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> SilencesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[silence_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -91,7 +89,7 @@ def create( def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[silence_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -114,8 +112,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -132,7 +128,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -154,8 +150,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -171,7 +165,7 @@ def delete( self, silence_id: str, *, - account_id: str | None = None, + account_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, @@ -195,8 +189,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not silence_id: @@ -215,7 +207,7 @@ def get( self, silence_id: str, *, - account_id: str | None = None, + account_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, @@ -239,8 +231,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not silence_id: @@ -283,7 +273,7 @@ def with_streaming_response(self) -> AsyncSilencesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[silence_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -306,8 +296,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -322,7 +310,7 @@ async def create( def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[silence_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -345,8 +333,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -363,7 +349,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -385,8 +371,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -402,7 +386,7 @@ async def delete( self, silence_id: str, *, - account_id: str | None = None, + account_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, @@ -426,8 +410,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not silence_id: @@ -446,7 +428,7 @@ async def get( self, silence_id: str, *, - account_id: str | None = None, + account_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, @@ -470,8 +452,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not silence_id: diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index c79d9f3fc16..bb992c1db09 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse def update( self, *, - zone_id: str | None = None, + zone_id: str, auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic], normalize: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -75,8 +75,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -99,7 +97,7 @@ def update( def get( self, *, - zone_id: str | None = None, + zone_id: str, normalize: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -125,8 +123,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -166,7 +162,7 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes async def update( self, *, - zone_id: str | None = None, + zone_id: str, auth_id_characteristics: Iterable[configuration_update_params.AuthIDCharacteristic], normalize: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -194,8 +190,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -220,7 +214,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + zone_id: str, normalize: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -246,8 +240,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/api_gateway/discovery/discovery.py b/src/cloudflare/resources/api_gateway/discovery/discovery.py index 4e20f1bc08e..14b90ec0846 100644 --- a/src/cloudflare/resources/api_gateway/discovery/discovery.py +++ b/src/cloudflare/resources/api_gateway/discovery/discovery.py @@ -58,7 +58,7 @@ def with_streaming_response(self) -> DiscoveryResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -81,8 +81,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -125,7 +123,7 @@ def with_streaming_response(self) -> AsyncDiscoveryResourceWithStreamingResponse async def get( self, *, - zone_id: str | None = None, + 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, @@ -148,8 +146,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/api_gateway/discovery/operations.py b/src/cloudflare/resources/api_gateway/discovery/operations.py index f7f224726c4..05e07b25d32 100644 --- a/src/cloudflare/resources/api_gateway/discovery/operations.py +++ b/src/cloudflare/resources/api_gateway/discovery/operations.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> OperationsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, diff: bool | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, endpoint: str | Omit = omit, @@ -117,8 +117,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -151,7 +149,7 @@ def list( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Dict[str, operation_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -174,8 +172,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -195,7 +191,7 @@ def edit( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, state: Literal["review", "ignored"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -225,8 +221,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -272,7 +266,7 @@ def with_streaming_response(self) -> AsyncOperationsResourceWithStreamingRespons def list( self, *, - zone_id: str | None = None, + zone_id: str, diff: bool | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, endpoint: str | Omit = omit, @@ -338,8 +332,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -372,7 +364,7 @@ def list( async def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Dict[str, operation_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -395,8 +387,6 @@ async def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -416,7 +406,7 @@ async def edit( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, state: Literal["review", "ignored"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -446,8 +436,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index ad850206763..1cd7e690f97 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> FallthroughResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, hosts: SequenceNotStr[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. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -115,7 +113,7 @@ def with_streaming_response(self) -> AsyncFallthroughResourceWithStreamingRespon async def create( self, *, - zone_id: str | None = None, + zone_id: str, hosts: SequenceNotStr[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. @@ -142,8 +140,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( diff --git a/src/cloudflare/resources/api_gateway/labels/labels.py b/src/cloudflare/resources/api_gateway/labels/labels.py index 0072827b371..4cf079cd384 100644 --- a/src/cloudflare/resources/api_gateway/labels/labels.py +++ b/src/cloudflare/resources/api_gateway/labels/labels.py @@ -71,7 +71,7 @@ def with_streaming_response(self) -> LabelsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, filter: str | Omit = omit, order: Literal["name", "description", "created_at", "last_updated", "mapped_resources.operations"] @@ -115,8 +115,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -175,7 +173,7 @@ def with_streaming_response(self) -> AsyncLabelsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, filter: str | Omit = omit, order: Literal["name", "description", "created_at", "last_updated", "mapped_resources.operations"] @@ -219,8 +217,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/api_gateway/labels/managed/managed.py b/src/cloudflare/resources/api_gateway/labels/managed/managed.py index 9a1c9a7dc32..c0a24e0e864 100644 --- a/src/cloudflare/resources/api_gateway/labels/managed/managed.py +++ b/src/cloudflare/resources/api_gateway/labels/managed/managed.py @@ -60,7 +60,7 @@ def get( self, name: str, *, - zone_id: str | None = None, + zone_id: str, with_mapped_resource_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,8 +87,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -137,7 +135,7 @@ async def get( self, name: str, *, - zone_id: str | None = None, + zone_id: str, with_mapped_resource_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -164,8 +162,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: diff --git a/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py b/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py index 632bc9392db..8319f6ab9fa 100644 --- a/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py +++ b/src/cloudflare/resources/api_gateway/labels/managed/resources/operation.py @@ -48,7 +48,7 @@ def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, selector: operation_update_params.Selector, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -121,7 +119,7 @@ async def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, selector: operation_update_params.Selector, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -148,8 +146,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: diff --git a/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py b/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py index dc4cbc01ea5..44e9af77943 100644 --- a/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py +++ b/src/cloudflare/resources/api_gateway/labels/user/resources/operation.py @@ -48,7 +48,7 @@ def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, selector: operation_update_params.Selector, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -121,7 +119,7 @@ async def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, selector: operation_update_params.Selector, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -148,8 +146,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: diff --git a/src/cloudflare/resources/api_gateway/labels/user/user.py b/src/cloudflare/resources/api_gateway/labels/user/user.py index ac3693f85f4..9b333813aa0 100644 --- a/src/cloudflare/resources/api_gateway/labels/user/user.py +++ b/src/cloudflare/resources/api_gateway/labels/user/user.py @@ -66,7 +66,7 @@ def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -96,8 +96,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -125,7 +123,7 @@ def delete( self, name: str, *, - zone_id: str | None = None, + 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, @@ -149,8 +147,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -170,7 +166,7 @@ def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[user_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -193,8 +189,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -211,7 +205,7 @@ def bulk_create( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -233,8 +227,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -251,7 +243,7 @@ def edit( self, name: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -281,8 +273,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -310,7 +300,7 @@ def get( self, name: str, *, - zone_id: str | None = None, + zone_id: str, with_mapped_resource_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -337,8 +327,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -387,7 +375,7 @@ async def update( self, name: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -417,8 +405,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -446,7 +432,7 @@ async def delete( self, name: str, *, - zone_id: str | None = None, + 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, @@ -470,8 +456,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -491,7 +475,7 @@ async def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[user_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -514,8 +498,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -532,7 +514,7 @@ def bulk_create( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -554,8 +536,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -572,7 +552,7 @@ async def edit( self, name: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, metadata: object | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -602,8 +582,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: @@ -631,7 +609,7 @@ async def get( self, name: str, *, - zone_id: str | None = None, + zone_id: str, with_mapped_resource_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -658,8 +636,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not name: diff --git a/src/cloudflare/resources/api_gateway/operations/labels.py b/src/cloudflare/resources/api_gateway/operations/labels.py index 9191bf97b8b..8b2762ee990 100644 --- a/src/cloudflare/resources/api_gateway/operations/labels.py +++ b/src/cloudflare/resources/api_gateway/operations/labels.py @@ -59,7 +59,7 @@ def create( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, managed: SequenceNotStr[str] | Omit = omit, user: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -89,8 +89,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -122,7 +120,7 @@ def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, managed: SequenceNotStr[str] | Omit = omit, user: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -154,8 +152,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -187,7 +183,7 @@ def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -211,8 +207,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -236,7 +230,7 @@ def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, selector: label_bulk_create_params.Selector, managed: label_bulk_create_params.Managed | Omit = omit, user: label_bulk_create_params.User | Omit = omit, @@ -263,8 +257,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -288,7 +280,7 @@ def bulk_create( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -310,8 +302,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -327,7 +317,7 @@ def bulk_delete( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, managed: label_bulk_update_params.Managed, selector: label_bulk_update_params.Selector, user: label_bulk_update_params.User, @@ -358,8 +348,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -405,7 +393,7 @@ async def create( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, managed: SequenceNotStr[str] | Omit = omit, user: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -435,8 +423,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -468,7 +454,7 @@ async def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, managed: SequenceNotStr[str] | Omit = omit, user: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -500,8 +486,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -533,7 +517,7 @@ async def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -557,8 +541,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -582,7 +564,7 @@ async def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, selector: label_bulk_create_params.Selector, managed: label_bulk_create_params.Managed | Omit = omit, user: label_bulk_create_params.User | Omit = omit, @@ -609,8 +591,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -634,7 +614,7 @@ def bulk_create( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -656,8 +636,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -673,7 +651,7 @@ def bulk_delete( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, managed: label_bulk_update_params.Managed, selector: label_bulk_update_params.Selector, user: label_bulk_update_params.User, @@ -704,8 +682,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 9b90cb22f15..3850a9a70ec 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -83,7 +83,7 @@ def with_streaming_response(self) -> OperationsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, endpoint: str, host: str, method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], @@ -122,8 +122,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -149,7 +147,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, endpoint: str | Omit = omit, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, @@ -199,8 +197,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -232,7 +228,7 @@ def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -258,8 +254,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -277,7 +271,7 @@ def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[operation_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -305,8 +299,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -323,7 +315,7 @@ def bulk_create( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -346,8 +338,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -362,7 +352,7 @@ def get( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -392,8 +382,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -445,7 +433,7 @@ def with_streaming_response(self) -> AsyncOperationsResourceWithStreamingRespons async def create( self, *, - zone_id: str | None = None, + zone_id: str, endpoint: str, host: str, method: Literal["GET", "POST", "HEAD", "OPTIONS", "PUT", "DELETE", "CONNECT", "PATCH", "TRACE"], @@ -484,8 +472,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -511,7 +497,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, endpoint: str | Omit = omit, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, @@ -561,8 +547,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -594,7 +578,7 @@ async def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -620,8 +604,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -639,7 +621,7 @@ async def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[operation_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -667,8 +649,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -685,7 +665,7 @@ def bulk_create( async def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -708,8 +688,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -724,7 +702,7 @@ async def get( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -754,8 +732,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: diff --git a/src/cloudflare/resources/api_gateway/operations/schema_validation.py b/src/cloudflare/resources/api_gateway/operations/schema_validation.py index dd93f97c5e6..5ce627a3fb4 100644 --- a/src/cloudflare/resources/api_gateway/operations/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/operations/schema_validation.py @@ -60,7 +60,7 @@ def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, mitigation_action: Optional[Literal["log", "block", "none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -94,8 +94,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -121,7 +119,7 @@ def update( def edit( self, *, - zone_id: str | None = None, + zone_id: str, settings_multiple_request: SettingsMultipleRequestParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -144,8 +142,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -168,7 +164,7 @@ def get( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -192,8 +188,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -238,7 +232,7 @@ async def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, mitigation_action: Optional[Literal["log", "block", "none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,8 +266,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -299,7 +291,7 @@ async def update( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, settings_multiple_request: SettingsMultipleRequestParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -322,8 +314,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -348,7 +338,7 @@ async def get( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -372,8 +362,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: diff --git a/src/cloudflare/resources/api_gateway/schemas.py b/src/cloudflare/resources/api_gateway/schemas.py index aa754506f6d..9815d3a6516 100644 --- a/src/cloudflare/resources/api_gateway/schemas.py +++ b/src/cloudflare/resources/api_gateway/schemas.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> SchemasResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, host: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -78,8 +78,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -125,7 +123,7 @@ def with_streaming_response(self) -> AsyncSchemasResourceWithStreamingResponse: async def list( self, *, - zone_id: str | None = None, + zone_id: str, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, host: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -155,8 +153,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/api_gateway/settings/schema_validation.py b/src/cloudflare/resources/api_gateway/settings/schema_validation.py index 0f2995bbc91..b255af4b1ac 100644 --- a/src/cloudflare/resources/api_gateway/settings/schema_validation.py +++ b/src/cloudflare/resources/api_gateway/settings/schema_validation.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> SchemaValidationResourceWithStreamingRespon def update( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -93,8 +93,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -118,7 +116,7 @@ def update( def edit( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | Omit = omit, validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -161,8 +159,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -186,7 +182,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -208,8 +204,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -247,7 +241,7 @@ def with_streaming_response(self) -> AsyncSchemaValidationResourceWithStreamingR async def update( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -289,8 +283,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -314,7 +306,7 @@ async def update( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] | Omit = omit, validation_override_mitigation_action: Optional[Literal["none", "disable_override"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -357,8 +349,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -382,7 +372,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -404,8 +394,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index f3b2531c3d2..c7ac5ba4142 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> HostsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -130,7 +128,7 @@ def with_streaming_response(self) -> AsyncHostsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,8 +158,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/api_gateway/user_schemas/operations.py b/src/cloudflare/resources/api_gateway/user_schemas/operations.py index 59d6e6cce79..19bdd4ac04c 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/operations.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/operations.py @@ -53,7 +53,7 @@ def list( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, endpoint: str | Omit = omit, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, host: SequenceNotStr[str] | Omit = omit, @@ -103,8 +103,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -163,7 +161,7 @@ def list( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, endpoint: str | Omit = omit, feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit, host: SequenceNotStr[str] | Omit = omit, @@ -213,8 +211,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py index 946cdc27aba..8b3dd284e3b 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -84,7 +84,7 @@ def with_streaming_response(self) -> UserSchemasResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, file: FileTypes, kind: Literal["openapi_v3"], name: str | Omit = omit, @@ -118,8 +118,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") body = deepcopy_minimal( @@ -155,7 +153,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -190,8 +188,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -222,7 +218,7 @@ def delete( self, schema_id: str, *, - zone_id: str | None = None, + 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, @@ -246,8 +242,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -269,7 +263,7 @@ def edit( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_enabled: Literal[True] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -296,8 +290,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -326,7 +318,7 @@ def get( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -352,8 +344,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -408,7 +398,7 @@ def with_streaming_response(self) -> AsyncUserSchemasResourceWithStreamingRespon async def create( self, *, - zone_id: str | None = None, + zone_id: str, file: FileTypes, kind: Literal["openapi_v3"], name: str | Omit = omit, @@ -442,8 +432,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") body = deepcopy_minimal( @@ -479,7 +467,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -514,8 +502,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -546,7 +532,7 @@ async def delete( self, schema_id: str, *, - zone_id: str | None = None, + 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, @@ -570,8 +556,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -593,7 +577,7 @@ async def edit( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_enabled: Literal[True] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -620,8 +604,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -650,7 +632,7 @@ async def get( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -676,8 +658,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: diff --git a/src/cloudflare/resources/argo/smart_routing.py b/src/cloudflare/resources/argo/smart_routing.py index 81eedc11d47..cd379828f7d 100644 --- a/src/cloudflare/resources/argo/smart_routing.py +++ b/src/cloudflare/resources/argo/smart_routing.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SmartRoutingResourceWithStreamingResponse: def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -94,7 +92,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -116,8 +114,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -156,7 +152,7 @@ def with_streaming_response(self) -> AsyncSmartRoutingResourceWithStreamingRespo async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -181,8 +177,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -201,7 +195,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -223,8 +217,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/argo/tiered_caching.py b/src/cloudflare/resources/argo/tiered_caching.py index ccdecb2b9f4..789a9032f60 100644 --- a/src/cloudflare/resources/argo/tiered_caching.py +++ b/src/cloudflare/resources/argo/tiered_caching.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> TieredCachingResourceWithStreamingResponse: def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -84,8 +84,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -104,7 +102,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -136,8 +134,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -176,7 +172,7 @@ def with_streaming_response(self) -> AsyncTieredCachingResourceWithStreamingResp async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -211,8 +207,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -231,7 +225,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -263,8 +257,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/audit_logs.py b/src/cloudflare/resources/audit_logs.py deleted file mode 100644 index 1a682f5ac0e..00000000000 --- a/src/cloudflare/resources/audit_logs.py +++ /dev/null @@ -1,276 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from datetime import date, datetime -from typing_extensions import Literal - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.audit_logs import audit_log_list_params -from ..types.shared.audit_log import AuditLog - -__all__ = ["AuditLogsResource", "AsyncAuditLogsResource"] - - -class AuditLogsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> AuditLogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AuditLogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AuditLogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AuditLogsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - id: str | Omit = omit, - action: audit_log_list_params.Action | Omit = omit, - actor: audit_log_list_params.Actor | Omit = omit, - before: Union[Union[str, date], Union[str, datetime]] | Omit = omit, - direction: Literal["desc", "asc"] | Omit = omit, - export: bool | Omit = omit, - hide_user_logs: bool | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - since: Union[Union[str, date], Union[str, datetime]] | Omit = omit, - zone: audit_log_list_params.Zone | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[AuditLog]: - """Gets a list of audit logs for an account. - - Can be filtered by who made the - change, on which zone, and the timeframe of the change. - - Args: - account_id: Identifier - - id: Finds a specific log by its ID. - - before: Limits the returned results to logs older than the specified date. A `full-date` - that conforms to RFC3339. - - direction: Changes the direction of the chronological sorting. - - export: Indicates that this request is an export of logs in CSV format. - - hide_user_logs: Indicates whether or not to hide user level audit logs. - - page: Defines which page of results to return. - - per_page: Sets the number of results to return per page. - - since: Limits the returned results to logs newer than the specified date. A `full-date` - that conforms to RFC3339. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}") - return self._get_api_list( - f"/accounts/{account_id}/audit_logs", - page=SyncV4PagePaginationArray[AuditLog], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "id": id, - "action": action, - "actor": actor, - "before": before, - "direction": direction, - "export": export, - "hide_user_logs": hide_user_logs, - "page": page, - "per_page": per_page, - "since": since, - "zone": zone, - }, - audit_log_list_params.AuditLogListParams, - ), - ), - model=AuditLog, - ) - - -class AsyncAuditLogsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncAuditLogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncAuditLogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncAuditLogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncAuditLogsResourceWithStreamingResponse(self) - - def list( - self, - *, - account_id: str, - id: str | Omit = omit, - action: audit_log_list_params.Action | Omit = omit, - actor: audit_log_list_params.Actor | Omit = omit, - before: Union[Union[str, date], Union[str, datetime]] | Omit = omit, - direction: Literal["desc", "asc"] | Omit = omit, - export: bool | Omit = omit, - hide_user_logs: bool | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - since: Union[Union[str, date], Union[str, datetime]] | Omit = omit, - zone: audit_log_list_params.Zone | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[AuditLog, AsyncV4PagePaginationArray[AuditLog]]: - """Gets a list of audit logs for an account. - - Can be filtered by who made the - change, on which zone, and the timeframe of the change. - - Args: - account_id: Identifier - - id: Finds a specific log by its ID. - - before: Limits the returned results to logs older than the specified date. A `full-date` - that conforms to RFC3339. - - direction: Changes the direction of the chronological sorting. - - export: Indicates that this request is an export of logs in CSV format. - - hide_user_logs: Indicates whether or not to hide user level audit logs. - - page: Defines which page of results to return. - - per_page: Sets the number of results to return per page. - - since: Limits the returned results to logs newer than the specified date. A `full-date` - that conforms to RFC3339. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}") - return self._get_api_list( - f"/accounts/{account_id}/audit_logs", - page=AsyncV4PagePaginationArray[AuditLog], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "id": id, - "action": action, - "actor": actor, - "before": before, - "direction": direction, - "export": export, - "hide_user_logs": hide_user_logs, - "page": page, - "per_page": per_page, - "since": since, - "zone": zone, - }, - audit_log_list_params.AuditLogListParams, - ), - ), - model=AuditLog, - ) - - -class AuditLogsResourceWithRawResponse: - def __init__(self, audit_logs: AuditLogsResource) -> None: - self._audit_logs = audit_logs - - self.list = to_raw_response_wrapper( - audit_logs.list, - ) - - -class AsyncAuditLogsResourceWithRawResponse: - def __init__(self, audit_logs: AsyncAuditLogsResource) -> None: - self._audit_logs = audit_logs - - self.list = async_to_raw_response_wrapper( - audit_logs.list, - ) - - -class AuditLogsResourceWithStreamingResponse: - def __init__(self, audit_logs: AuditLogsResource) -> None: - self._audit_logs = audit_logs - - self.list = to_streamed_response_wrapper( - audit_logs.list, - ) - - -class AsyncAuditLogsResourceWithStreamingResponse: - def __init__(self, audit_logs: AsyncAuditLogsResource) -> None: - self._audit_logs = audit_logs - - self.list = async_to_streamed_response_wrapper( - audit_logs.list, - ) diff --git a/src/cloudflare/resources/audit_logs/audit_logs.py b/src/cloudflare/resources/audit_logs/audit_logs.py index dc718943528..393e46bc3a1 100644 --- a/src/cloudflare/resources/audit_logs/audit_logs.py +++ b/src/cloudflare/resources/audit_logs/audit_logs.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> AuditLogsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, action: audit_log_list_params.Action | Omit = omit, actor: audit_log_list_params.Actor | Omit = omit, @@ -102,8 +102,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -158,7 +156,7 @@ def with_streaming_response(self) -> AsyncAuditLogsResourceWithStreamingResponse def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, action: audit_log_list_params.Action | Omit = omit, actor: audit_log_list_params.Actor | Omit = omit, @@ -211,8 +209,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/billing/profiles.py b/src/cloudflare/resources/billing/profiles.py index 54fe1721609..5a59fc5223a 100644 --- a/src/cloudflare/resources/billing/profiles.py +++ b/src/cloudflare/resources/billing/profiles.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ProfilesResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -70,8 +70,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -111,7 +109,7 @@ def with_streaming_response(self) -> AsyncProfilesResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -133,8 +131,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/billing/usage.py b/src/cloudflare/resources/billing/usage.py index 1b3636edb18..d847aea692d 100644 --- a/src/cloudflare/resources/billing/usage.py +++ b/src/cloudflare/resources/billing/usage.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> UsageResourceWithStreamingResponse: def paygo( self, *, - account_id: str | None = None, + account_id: str, from_: Union[str, date] | Omit = omit, to: Union[str, date] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def paygo( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -126,7 +124,7 @@ def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: async def paygo( self, *, - account_id: str | None = None, + account_id: str, from_: Union[str, date] | Omit = omit, to: Union[str, date] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -157,8 +155,6 @@ async def paygo( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/bot_management.py b/src/cloudflare/resources/bot_management.py deleted file mode 100644 index 07b76763411..00000000000 --- a/src/cloudflare/resources/bot_management.py +++ /dev/null @@ -1,1274 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Any, Optional, cast -from typing_extensions import Literal, overload - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import required_args, maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.bot_management import bot_management_update_params -from ..types.bot_management.bot_management_get_response import BotManagementGetResponse -from ..types.bot_management.bot_management_update_response import BotManagementUpdateResponse - -__all__ = ["BotManagementResource", "AsyncBotManagementResource"] - - -class BotManagementResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> BotManagementResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return BotManagementResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> BotManagementResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return BotManagementResourceWithStreamingResponse(self) - - @overload - def update( - self, - *, - zone_id: str, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - fight_mode: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - 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. - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - 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_likely_automated: Super Bot Fight Mode (SBFM) action to take on likely 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - auto_update_model: bool | Omit = omit, - bm_cookie_enabled: bool | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - suppress_session_score: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - 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) - - bm_cookie_enabled: Indicates that the bot management cookie can be placed on end user devices - accessing the site. Defaults to true - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot - Management cookie. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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"]) - def update( - self, - *, - zone_id: str, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - fight_mode: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - auto_update_model: bool | Omit = omit, - bm_cookie_enabled: bool | Omit = omit, - suppress_session_score: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[BotManagementUpdateResponse]: - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - Optional[BotManagementUpdateResponse], - self._put( - f"/zones/{zone_id}/bot_management", - body=maybe_transform( - { - "ai_bots_protection": ai_bots_protection, - "cf_robots_variant": cf_robots_variant, - "crawler_protection": crawler_protection, - "enable_js": enable_js, - "fight_mode": fight_mode, - "is_robots_txt_managed": is_robots_txt_managed, - "optimize_wordpress": optimize_wordpress, - "sbfm_definitely_automated": sbfm_definitely_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, - "bm_cookie_enabled": bm_cookie_enabled, - "suppress_session_score": suppress_session_score, - }, - bot_management_update_params.BotManagementUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BotManagementUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - def get( - 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, - ) -> Optional[BotManagementGetResponse]: - """ - Retrieve a zone's Bot Management Config - - 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 cast( - Optional[BotManagementGetResponse], - self._get( - f"/zones/{zone_id}/bot_management", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BotManagementGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncBotManagementResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncBotManagementResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncBotManagementResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncBotManagementResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncBotManagementResourceWithStreamingResponse(self) - - @overload - async def update( - self, - *, - zone_id: str, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - fight_mode: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - 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. - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - 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_likely_automated: Super Bot Fight Mode (SBFM) action to take on likely 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, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - auto_update_model: bool | Omit = omit, - bm_cookie_enabled: bool | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - suppress_session_score: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[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 \\ - If you recently upgraded or downgraded your plan, refer to the following examples - to clean up old configurations. Copy and paste the example body to remove old zone - configurations based on your current plan. - - #### Clean up configuration for Bot Fight Mode plan - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "suppress_session_score": false - } - ``` - - #### Clean up configuration for SBFM Pro plan - - ```json - { - "sbfm_likely_automated": "allow", - "fight_mode": false - } - ``` - - #### Clean up configuration for SBFM Biz plan - - ```json - { - "fight_mode": false - } - ``` - - #### Clean up configuration for BM Enterprise Subscription plan - - It is strongly recommended that you ensure you have - [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to - protect your zone before disabling the SBFM rules. Without these protections, - your zone is vulnerable to attacks. - - ```json - { - "sbfm_likely_automated": "allow", - "sbfm_definitely_automated": "allow", - "sbfm_verified_bots": "allow", - "sbfm_static_resource_protection": false, - "optimize_wordpress": false, - "fight_mode": false - } - ``` - - Args: - zone_id: Identifier. - - ai_bots_protection: Enable rule to block AI Scrapers and Crawlers. Please note the value - `only_on_ad_pages` is currently not available for Enterprise customers. - - 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) - - bm_cookie_enabled: Indicates that the bot management cookie can be placed on end user devices - accessing the site. Defaults to true - - cf_robots_variant: Specifies the Robots Access Control License variant to use. - - crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. - - enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. - [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - - is_robots_txt_managed: Enable cloudflare managed robots.txt. If an existing robots.txt is detected, - then managed robots.txt will be prepended to the existing robots.txt. - - suppress_session_score: Whether to disable tracking the highest bot score for a session in the Bot - Management cookie. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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"]) - async def update( - self, - *, - zone_id: str, - ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, - cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, - crawler_protection: Literal["enabled", "disabled"] | Omit = omit, - enable_js: bool | Omit = omit, - fight_mode: bool | Omit = omit, - is_robots_txt_managed: bool | Omit = omit, - optimize_wordpress: bool | Omit = omit, - sbfm_definitely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - sbfm_static_resource_protection: bool | Omit = omit, - sbfm_verified_bots: Literal["allow", "block"] | Omit = omit, - sbfm_likely_automated: Literal["allow", "block", "managed_challenge"] | Omit = omit, - auto_update_model: bool | Omit = omit, - bm_cookie_enabled: bool | Omit = omit, - suppress_session_score: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[BotManagementUpdateResponse]: - if not zone_id: - raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return cast( - Optional[BotManagementUpdateResponse], - await self._put( - f"/zones/{zone_id}/bot_management", - body=await async_maybe_transform( - { - "ai_bots_protection": ai_bots_protection, - "cf_robots_variant": cf_robots_variant, - "crawler_protection": crawler_protection, - "enable_js": enable_js, - "fight_mode": fight_mode, - "is_robots_txt_managed": is_robots_txt_managed, - "optimize_wordpress": optimize_wordpress, - "sbfm_definitely_automated": sbfm_definitely_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, - "bm_cookie_enabled": bm_cookie_enabled, - "suppress_session_score": suppress_session_score, - }, - bot_management_update_params.BotManagementUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BotManagementUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BotManagementUpdateResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - async def get( - 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, - ) -> Optional[BotManagementGetResponse]: - """ - Retrieve a zone's Bot Management Config - - 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 cast( - Optional[BotManagementGetResponse], - await self._get( - f"/zones/{zone_id}/bot_management", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[BotManagementGetResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[BotManagementGetResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class BotManagementResourceWithRawResponse: - def __init__(self, bot_management: BotManagementResource) -> None: - self._bot_management = bot_management - - self.update = to_raw_response_wrapper( - bot_management.update, - ) - self.get = to_raw_response_wrapper( - bot_management.get, - ) - - -class AsyncBotManagementResourceWithRawResponse: - def __init__(self, bot_management: AsyncBotManagementResource) -> None: - self._bot_management = bot_management - - self.update = async_to_raw_response_wrapper( - bot_management.update, - ) - self.get = async_to_raw_response_wrapper( - bot_management.get, - ) - - -class BotManagementResourceWithStreamingResponse: - def __init__(self, bot_management: BotManagementResource) -> None: - self._bot_management = bot_management - - self.update = to_streamed_response_wrapper( - bot_management.update, - ) - self.get = to_streamed_response_wrapper( - bot_management.get, - ) - - -class AsyncBotManagementResourceWithStreamingResponse: - def __init__(self, bot_management: AsyncBotManagementResource) -> None: - self._bot_management = bot_management - - self.update = async_to_streamed_response_wrapper( - bot_management.update, - ) - self.get = async_to_streamed_response_wrapper( - bot_management.get, - ) diff --git a/src/cloudflare/resources/bot_management/bot_management.py b/src/cloudflare/resources/bot_management/bot_management.py index dfa0e3cf12a..1c3cd53addc 100644 --- a/src/cloudflare/resources/bot_management/bot_management.py +++ b/src/cloudflare/resources/bot_management/bot_management.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -50,9 +50,10 @@ def with_streaming_response(self) -> BotManagementResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, fight_mode: bool | Omit = omit, @@ -135,6 +136,10 @@ def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -159,9 +164,10 @@ def update( def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -247,6 +253,10 @@ def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -279,9 +289,10 @@ def update( def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -368,6 +379,10 @@ def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -402,11 +417,12 @@ def update( def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, auto_update_model: bool | Omit = omit, bm_cookie_enabled: bool | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -496,6 +512,10 @@ def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -517,12 +537,14 @@ def update( """ ... + @required_args(["zone_id"]) def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, fight_mode: bool | Omit = omit, @@ -542,8 +564,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -554,6 +574,7 @@ def update( { "ai_bots_protection": ai_bots_protection, "cf_robots_variant": cf_robots_variant, + "content_bots_protection": content_bots_protection, "crawler_protection": crawler_protection, "enable_js": enable_js, "fight_mode": fight_mode, @@ -585,7 +606,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -607,8 +628,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -653,9 +672,10 @@ def with_streaming_response(self) -> AsyncBotManagementResourceWithStreamingResp async def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, fight_mode: bool | Omit = omit, @@ -738,6 +758,10 @@ async def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -762,9 +786,10 @@ async def update( async def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -850,6 +875,10 @@ async def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -882,9 +911,10 @@ async def update( async def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -971,6 +1001,10 @@ async def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -1005,11 +1039,12 @@ async def update( async def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, auto_update_model: bool | Omit = omit, bm_cookie_enabled: bool | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, is_robots_txt_managed: bool | Omit = omit, @@ -1099,6 +1134,10 @@ async def update( cf_robots_variant: Specifies the Robots Access Control License variant to use. + content_bots_protection: Enable rule to block content bots. When enabled, blocks automated traffic with + low bot scores, excluding safe verified bot categories. Exceptions should be + managed via skip rules. + crawler_protection: Enable rule to punish AI Scrapers and Crawlers via a link maze. enable_js: Use lightweight, invisible JavaScript detections to improve Bot Management. @@ -1120,12 +1159,14 @@ async def update( """ ... + @required_args(["zone_id"]) async def update( self, *, - zone_id: str | None = None, + zone_id: str, ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] | Omit = omit, cf_robots_variant: Literal["off", "policy_only"] | Omit = omit, + content_bots_protection: Literal["block", "disabled"] | Omit = omit, crawler_protection: Literal["enabled", "disabled"] | Omit = omit, enable_js: bool | Omit = omit, fight_mode: bool | Omit = omit, @@ -1145,8 +1186,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[BotManagementUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -1157,6 +1196,7 @@ async def update( { "ai_bots_protection": ai_bots_protection, "cf_robots_variant": cf_robots_variant, + "content_bots_protection": content_bots_protection, "crawler_protection": crawler_protection, "enable_js": enable_js, "fight_mode": fight_mode, @@ -1188,7 +1228,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -1210,8 +1250,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( diff --git a/src/cloudflare/resources/botnet_feed/asn.py b/src/cloudflare/resources/botnet_feed/asn.py index d5f9b3a3cbf..9e984c63ccd 100755 --- a/src/cloudflare/resources/botnet_feed/asn.py +++ b/src/cloudflare/resources/botnet_feed/asn.py @@ -50,7 +50,7 @@ def day_report( self, asn_id: int, *, - account_id: str | None = None, + account_id: str, date: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def day_report( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -98,7 +96,7 @@ def full_report( self, asn_id: int, *, - account_id: str | None = None, + account_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, @@ -121,8 +119,6 @@ def full_report( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -164,7 +160,7 @@ async def day_report( self, asn_id: int, *, - account_id: str | None = None, + account_id: str, date: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -189,8 +185,6 @@ async def day_report( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -212,7 +206,7 @@ async def full_report( self, asn_id: int, *, - account_id: str | None = None, + account_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, @@ -235,8 +229,6 @@ async def full_report( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/botnet_feed/configs/asn.py b/src/cloudflare/resources/botnet_feed/configs/asn.py index 5313cf8499c..7c70119ad8f 100755 --- a/src/cloudflare/resources/botnet_feed/configs/asn.py +++ b/src/cloudflare/resources/botnet_feed/configs/asn.py @@ -48,7 +48,7 @@ def delete( self, asn_id: int, *, - account_id: str | None = None, + account_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, @@ -70,8 +70,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -91,7 +89,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -113,8 +111,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -154,7 +150,7 @@ async def delete( self, asn_id: int, *, - account_id: str | None = None, + account_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, @@ -176,8 +172,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -197,7 +191,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_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, @@ -219,8 +213,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/brand_protection.py b/src/cloudflare/resources/brand_protection/brand_protection.py index 624e5d3ad79..fcfde5b9b5c 100644 --- a/src/cloudflare/resources/brand_protection/brand_protection.py +++ b/src/cloudflare/resources/brand_protection/brand_protection.py @@ -105,7 +105,7 @@ def with_streaming_response(self) -> BrandProtectionResourceWithStreamingRespons def submit( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +125,6 @@ def submit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -140,7 +138,7 @@ def submit( def url_info( self, *, - account_id: str | None = None, + account_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, @@ -160,8 +158,6 @@ def url_info( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -217,7 +213,7 @@ def with_streaming_response(self) -> AsyncBrandProtectionResourceWithStreamingRe async def submit( self, *, - account_id: str | None = None, + account_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, @@ -237,8 +233,6 @@ async def submit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -252,7 +246,7 @@ async def submit( def url_info( self, *, - account_id: str | None = None, + account_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, @@ -272,8 +266,6 @@ def url_info( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/brand_protection/logo_matches.py b/src/cloudflare/resources/brand_protection/logo_matches.py index e8219c56bdd..7134e929c4e 100644 --- a/src/cloudflare/resources/brand_protection/logo_matches.py +++ b/src/cloudflare/resources/brand_protection/logo_matches.py @@ -45,7 +45,7 @@ def with_streaming_response(self) -> LogoMatchesResourceWithStreamingResponse: def download( self, *, - account_id: str | None = None, + account_id: str, limit: str | Omit = omit, logo_id: SequenceNotStr[str] | Omit = omit, offset: str | Omit = omit, @@ -68,8 +68,6 @@ def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -94,7 +92,7 @@ def download( def get( self, *, - account_id: str | None = None, + account_id: str, limit: str | Omit = omit, logo_id: SequenceNotStr[str] | Omit = omit, offset: str | Omit = omit, @@ -117,8 +115,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -164,7 +160,7 @@ def with_streaming_response(self) -> AsyncLogoMatchesResourceWithStreamingRespon async def download( self, *, - account_id: str | None = None, + account_id: str, limit: str | Omit = omit, logo_id: SequenceNotStr[str] | Omit = omit, offset: str | Omit = omit, @@ -187,8 +183,6 @@ async def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -213,7 +207,7 @@ async def download( async def get( self, *, - account_id: str | None = None, + account_id: str, limit: str | Omit = omit, logo_id: SequenceNotStr[str] | Omit = omit, offset: str | Omit = omit, @@ -236,8 +230,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/logos.py b/src/cloudflare/resources/brand_protection/logos.py index a432d1e0fc3..c8bdd8d39a4 100644 --- a/src/cloudflare/resources/brand_protection/logos.py +++ b/src/cloudflare/resources/brand_protection/logos.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> LogosResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, match_type: str | Omit = omit, tag: str | Omit = omit, threshold: float | Omit = omit, @@ -68,8 +68,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -96,7 +94,7 @@ def delete( self, logo_id: str, *, - account_id: str | None = None, + account_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, @@ -116,8 +114,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not logo_id: @@ -157,7 +153,7 @@ def with_streaming_response(self) -> AsyncLogosResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, match_type: str | Omit = omit, tag: str | Omit = omit, threshold: float | Omit = omit, @@ -181,8 +177,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -209,7 +203,7 @@ async def delete( self, logo_id: str, *, - account_id: str | None = None, + account_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, @@ -229,8 +223,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not logo_id: diff --git a/src/cloudflare/resources/brand_protection/matches.py b/src/cloudflare/resources/brand_protection/matches.py index 2ab27a7022f..e2ad88785c1 100644 --- a/src/cloudflare/resources/brand_protection/matches.py +++ b/src/cloudflare/resources/brand_protection/matches.py @@ -45,7 +45,7 @@ def with_streaming_response(self) -> MatchesResourceWithStreamingResponse: def download( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, include_domain_id: bool | Omit = omit, limit: int | Omit = omit, @@ -69,8 +69,6 @@ def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -96,7 +94,7 @@ def download( def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, include_domain_id: bool | Omit = omit, limit: int | Omit = omit, @@ -120,8 +118,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -168,7 +164,7 @@ def with_streaming_response(self) -> AsyncMatchesResourceWithStreamingResponse: async def download( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, include_domain_id: bool | Omit = omit, limit: int | Omit = omit, @@ -192,8 +188,6 @@ async def download( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -219,7 +213,7 @@ async def download( async def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, include_domain_id: bool | Omit = omit, limit: int | Omit = omit, @@ -243,8 +237,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/queries.py b/src/cloudflare/resources/brand_protection/queries.py index 6d1cbab77d1..53c5d644219 100644 --- a/src/cloudflare/resources/brand_protection/queries.py +++ b/src/cloudflare/resources/brand_protection/queries.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> QueriesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, query_scan: bool | Omit = omit, query_tag: str | Omit = omit, @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -111,7 +109,7 @@ def create( def delete( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, scan: bool | Omit = omit, tag: str | Omit = omit, @@ -134,8 +132,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -161,7 +157,7 @@ def delete( def bulk( self, *, - account_id: str | None = None, + account_id: str, queries: Iterable[Dict[str, object]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -182,8 +178,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -220,7 +214,7 @@ def with_streaming_response(self) -> AsyncQueriesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, query_scan: bool | Omit = omit, query_tag: str | Omit = omit, @@ -248,8 +242,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -285,7 +277,7 @@ async def create( async def delete( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, scan: bool | Omit = omit, tag: str | Omit = omit, @@ -308,8 +300,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -335,7 +325,7 @@ async def delete( async def bulk( self, *, - account_id: str | None = None, + account_id: str, queries: Iterable[Dict[str, object]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -356,8 +346,6 @@ async def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} diff --git a/src/cloudflare/resources/brand_protection/v2/logo_matches.py b/src/cloudflare/resources/brand_protection/v2/logo_matches.py index ae58cf9010e..2c50be665aa 100644 --- a/src/cloudflare/resources/brand_protection/v2/logo_matches.py +++ b/src/cloudflare/resources/brand_protection/v2/logo_matches.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> LogoMatchesResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, query_id: str, download: str | Omit = omit, limit: str | Omit = omit, @@ -77,8 +77,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -129,7 +127,7 @@ def with_streaming_response(self) -> AsyncLogoMatchesResourceWithStreamingRespon async def get( self, *, - account_id: str | None = None, + account_id: str, query_id: str, download: str | Omit = omit, limit: str | Omit = omit, @@ -160,8 +158,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/v2/logos.py b/src/cloudflare/resources/brand_protection/v2/logos.py index 2472996be7e..42f3f433137 100644 --- a/src/cloudflare/resources/brand_protection/v2/logos.py +++ b/src/cloudflare/resources/brand_protection/v2/logos.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> LogosResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, image_data: str, similarity_threshold: float, tag: str, @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def delete( self, query_id: str, *, - account_id: str | None = None, + account_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, @@ -129,8 +127,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not query_id: @@ -150,7 +146,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, download: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -179,8 +175,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -227,7 +221,7 @@ def with_streaming_response(self) -> AsyncLogosResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, image_data: str, similarity_threshold: float, tag: str, @@ -261,8 +255,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -288,7 +280,7 @@ async def delete( self, query_id: str, *, - account_id: str | None = None, + account_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, @@ -310,8 +302,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not query_id: @@ -331,7 +321,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, download: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -360,8 +350,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/v2/matches.py b/src/cloudflare/resources/brand_protection/v2/matches.py index aecd7fca0f9..44e66a5a419 100644 --- a/src/cloudflare/resources/brand_protection/v2/matches.py +++ b/src/cloudflare/resources/brand_protection/v2/matches.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> MatchesResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, query_id: SequenceNotStr[str], domain_search: str | Omit = omit, include_dismissed: str | Omit = omit, @@ -65,12 +65,13 @@ def get( """ Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated - across queries and each match includes a matched_queries array. + across queries and each match includes a match_details array with per-match + query metadata and individual dismissed state. Args: query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided, - matches are deduplicated across queries and each match includes matched_queries - and match_ids arrays. + matches are deduplicated across queries and each match includes a match_details + array with per-match query metadata and dismissed state. domain_search: Filter matches by domain name (substring match) @@ -86,8 +87,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -140,7 +139,7 @@ def with_streaming_response(self) -> AsyncMatchesResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, query_id: SequenceNotStr[str], domain_search: str | Omit = omit, include_dismissed: str | Omit = omit, @@ -159,12 +158,13 @@ async def get( """ Get paginated list of domain matches for one or more brand protection queries. When multiple query_ids are provided (comma-separated), matches are deduplicated - across queries and each match includes a matched_queries array. + across queries and each match includes a match_details array with per-match + query metadata and individual dismissed state. Args: query_id: Query ID or comma-separated list of Query IDs. When multiple IDs are provided, - matches are deduplicated across queries and each match includes matched_queries - and match_ids arrays. + matches are deduplicated across queries and each match includes a match_details + array with per-match query metadata and dismissed state. domain_search: Filter matches by domain name (substring match) @@ -180,8 +180,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/brand_protection/v2/queries.py b/src/cloudflare/resources/brand_protection/v2/queries.py index 78c84a29b3b..8275de5fc8e 100644 --- a/src/cloudflare/resources/brand_protection/v2/queries.py +++ b/src/cloudflare/resources/brand_protection/v2/queries.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> QueriesResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -65,8 +65,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -107,7 +105,7 @@ def with_streaming_response(self) -> AsyncQueriesResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -128,8 +126,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/browser_rendering/content.py b/src/cloudflare/resources/browser_rendering/content.py index f20bd6e729e..8e9b31dce6a 100644 --- a/src/cloudflare/resources/browser_rendering/content.py +++ b/src/cloudflare/resources/browser_rendering/content.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> ContentResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -182,7 +182,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -312,11 +312,11 @@ def create( """ ... - @required_args(["url"], ["html"]) + @required_args(["account_id", "url"], ["account_id", "html"]) def create( self, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -401,8 +401,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -468,7 +466,7 @@ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -601,7 +599,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -731,11 +729,11 @@ async def create( """ ... - @required_args(["url"], ["html"]) + @required_args(["account_id", "url"], ["account_id", "html"]) async def create( self, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -820,8 +818,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/crawl.py b/src/cloudflare/resources/browser_rendering/crawl.py index 434b45d4b6e..85ee76c41c1 100644 --- a/src/cloudflare/resources/browser_rendering/crawl.py +++ b/src/cloudflare/resources/browser_rendering/crawl.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> CrawlResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -224,7 +224,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, render: Literal[False], url: str, cache_ttl: float | Omit = omit, @@ -297,11 +297,11 @@ def create( """ ... - @required_args(["url"], ["render", "url"]) + @required_args(["account_id", "url"], ["account_id", "render", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -382,8 +382,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -436,7 +434,7 @@ def delete( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -461,8 +459,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -485,7 +481,7 @@ def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, cache_ttl: float | Omit = omit, cursor: float | Omit = omit, limit: float | Omit = omit, @@ -521,8 +517,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -575,7 +569,7 @@ def with_streaming_response(self) -> AsyncCrawlResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -748,7 +742,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, render: Literal[False], url: str, cache_ttl: float | Omit = omit, @@ -821,11 +815,11 @@ async def create( """ ... - @required_args(["url"], ["render", "url"]) + @required_args(["account_id", "url"], ["account_id", "render", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -906,8 +900,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -960,7 +952,7 @@ async def delete( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -985,8 +977,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -1009,7 +999,7 @@ async def get( self, job_id: str, *, - account_id: str | None = None, + account_id: str, cache_ttl: float | Omit = omit, cursor: float | Omit = omit, limit: float | Omit = omit, @@ -1045,8 +1035,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: diff --git a/src/cloudflare/resources/browser_rendering/devtools/browser/browser.py b/src/cloudflare/resources/browser_rendering/devtools/browser/browser.py index 923aa11e68c..64451ef8143 100644 --- a/src/cloudflare/resources/browser_rendering/devtools/browser/browser.py +++ b/src/cloudflare/resources/browser_rendering/devtools/browser/browser.py @@ -71,7 +71,7 @@ def with_streaming_response(self) -> BrowserResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -103,8 +103,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -131,7 +129,7 @@ def delete( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -155,8 +153,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -177,7 +173,7 @@ def connect( self, session_id: str, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -208,8 +204,6 @@ def connect( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -241,7 +235,7 @@ def connect( def launch( self, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -270,8 +264,6 @@ def launch( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -298,7 +290,7 @@ def protocol( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -323,8 +315,6 @@ def protocol( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -345,7 +335,7 @@ def version( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -369,8 +359,6 @@ def version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -419,7 +407,7 @@ def with_streaming_response(self) -> AsyncBrowserResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -451,8 +439,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -479,7 +465,7 @@ async def delete( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -503,8 +489,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -525,7 +509,7 @@ async def connect( self, session_id: str, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -556,8 +540,6 @@ async def connect( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -589,7 +571,7 @@ async def connect( async def launch( self, *, - account_id: str | None = None, + account_id: str, keep_alive: float | Omit = omit, lab: bool | Omit = omit, recording: bool | Omit = omit, @@ -618,8 +600,6 @@ async def launch( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -646,7 +626,7 @@ async def protocol( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -671,8 +651,6 @@ async def protocol( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -693,7 +671,7 @@ async def version( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -717,8 +695,6 @@ async def version( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: diff --git a/src/cloudflare/resources/browser_rendering/devtools/browser/page.py b/src/cloudflare/resources/browser_rendering/devtools/browser/page.py index 3720014b6c2..c4207a5ee11 100644 --- a/src/cloudflare/resources/browser_rendering/devtools/browser/page.py +++ b/src/cloudflare/resources/browser_rendering/devtools/browser/page.py @@ -43,7 +43,7 @@ def get( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -70,8 +70,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -117,7 +115,7 @@ async def get( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -144,8 +142,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: diff --git a/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py b/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py index b35af4ac91d..75a19833916 100644 --- a/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py +++ b/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py @@ -48,7 +48,7 @@ def create( self, session_id: str, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -100,7 +98,7 @@ def list( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -147,7 +143,7 @@ def activate( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -174,8 +170,6 @@ def activate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -199,7 +193,7 @@ def get( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -226,8 +220,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -272,7 +264,7 @@ async def create( self, session_id: str, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -298,8 +290,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -324,7 +314,7 @@ async def list( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -349,8 +339,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -371,7 +359,7 @@ async def activate( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -398,8 +386,6 @@ async def activate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -423,7 +409,7 @@ async def get( self, target_id: str, *, - account_id: str | None = None, + account_id: str, session_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. @@ -450,8 +436,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: diff --git a/src/cloudflare/resources/browser_rendering/devtools/session.py b/src/cloudflare/resources/browser_rendering/devtools/session.py index 143c06efdc2..fd559e25de5 100644 --- a/src/cloudflare/resources/browser_rendering/devtools/session.py +++ b/src/cloudflare/resources/browser_rendering/devtools/session.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SessionResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, limit: float | Omit = omit, offset: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -71,8 +71,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -97,7 +95,7 @@ def get( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -121,8 +119,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: @@ -163,7 +159,7 @@ def with_streaming_response(self) -> AsyncSessionResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_id: str, limit: float | Omit = omit, offset: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -187,8 +183,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -213,7 +207,7 @@ async def get( self, session_id: str, *, - account_id: str | None = None, + account_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, @@ -237,8 +231,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not session_id: diff --git a/src/cloudflare/resources/browser_rendering/json.py b/src/cloudflare/resources/browser_rendering/json.py index 8c6999290d3..a69ab3e9053 100644 --- a/src/cloudflare/resources/browser_rendering/json.py +++ b/src/cloudflare/resources/browser_rendering/json.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> JsonResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -190,7 +190,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -326,11 +326,11 @@ def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -418,8 +418,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JsonCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -488,7 +486,7 @@ def with_streaming_response(self) -> AsyncJsonResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -629,7 +627,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -765,11 +763,11 @@ async def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -857,8 +855,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JsonCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/links.py b/src/cloudflare/resources/browser_rendering/links.py index 886765f77df..7ed30824fe6 100644 --- a/src/cloudflare/resources/browser_rendering/links.py +++ b/src/cloudflare/resources/browser_rendering/links.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> LinksResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -183,7 +183,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -312,11 +312,11 @@ def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -399,8 +399,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LinkCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -468,7 +466,7 @@ def with_streaming_response(self) -> AsyncLinksResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -602,7 +600,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -731,11 +729,11 @@ async def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -818,8 +816,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LinkCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/markdown.py b/src/cloudflare/resources/browser_rendering/markdown.py index b3c9acffbf9..f167d3aabb4 100644 --- a/src/cloudflare/resources/browser_rendering/markdown.py +++ b/src/cloudflare/resources/browser_rendering/markdown.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> MarkdownResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -182,7 +182,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -312,11 +312,11 @@ def create( """ ... - @required_args(["url"], ["html"]) + @required_args(["account_id", "url"], ["account_id", "html"]) def create( self, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -401,8 +401,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -468,7 +466,7 @@ def with_streaming_response(self) -> AsyncMarkdownResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -601,7 +599,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -731,11 +729,11 @@ async def create( """ ... - @required_args(["url"], ["html"]) + @required_args(["account_id", "url"], ["account_id", "html"]) async def create( self, *, - account_id: str | None = None, + account_id: str, url: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -820,8 +818,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/pdf.py b/src/cloudflare/resources/browser_rendering/pdf.py index 94b10940a88..375f8abbb92 100644 --- a/src/cloudflare/resources/browser_rendering/pdf.py +++ b/src/cloudflare/resources/browser_rendering/pdf.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> PDFResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -188,7 +188,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -320,11 +320,11 @@ def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -404,8 +404,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BinaryAPIResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} @@ -472,7 +470,7 @@ def with_streaming_response(self) -> AsyncPDFResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -609,7 +607,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -741,11 +739,11 @@ async def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -825,8 +823,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncBinaryAPIResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "application/pdf", **(extra_headers or {})} diff --git a/src/cloudflare/resources/browser_rendering/scrape.py b/src/cloudflare/resources/browser_rendering/scrape.py index 1447254c86e..142da2981b1 100644 --- a/src/cloudflare/resources/browser_rendering/scrape.py +++ b/src/cloudflare/resources/browser_rendering/scrape.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> ScrapeResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant0Element], html: str, cache_ttl: float | Omit = omit, @@ -182,7 +182,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant1Element], url: str, cache_ttl: float | Omit = omit, @@ -310,11 +310,11 @@ def create( """ ... - @required_args(["elements", "html"], ["elements", "url"]) + @required_args(["account_id", "elements", "html"], ["account_id", "elements", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant0Element] | Iterable[scrape_create_params.Variant1Element], html: str | Omit = omit, cache_ttl: float | Omit = omit, @@ -398,8 +398,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScrapeCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -466,7 +464,7 @@ def with_streaming_response(self) -> AsyncScrapeResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant0Element], html: str, cache_ttl: float | Omit = omit, @@ -599,7 +597,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant1Element], url: str, cache_ttl: float | Omit = omit, @@ -727,11 +725,11 @@ async def create( """ ... - @required_args(["elements", "html"], ["elements", "url"]) + @required_args(["account_id", "elements", "html"], ["account_id", "elements", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, elements: Iterable[scrape_create_params.Variant0Element] | Iterable[scrape_create_params.Variant1Element], html: str | Omit = omit, cache_ttl: float | Omit = omit, @@ -815,8 +813,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScrapeCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/screenshot.py b/src/cloudflare/resources/browser_rendering/screenshot.py index dc9b8c3d4ad..cbb3ce78793 100644 --- a/src/cloudflare/resources/browser_rendering/screenshot.py +++ b/src/cloudflare/resources/browser_rendering/screenshot.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ScreenshotResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -188,7 +188,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -323,11 +323,11 @@ def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -417,8 +417,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScreenshotCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -486,7 +484,7 @@ def with_streaming_response(self) -> AsyncScreenshotResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -626,7 +624,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -761,11 +759,11 @@ async def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -855,8 +853,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScreenshotCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/browser_rendering/snapshot.py b/src/cloudflare/resources/browser_rendering/snapshot.py index 14c959ef1fa..55d937e1c68 100644 --- a/src/cloudflare/resources/browser_rendering/snapshot.py +++ b/src/cloudflare/resources/browser_rendering/snapshot.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SnapshotResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -185,7 +185,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -316,11 +316,11 @@ def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -408,8 +408,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -476,7 +474,7 @@ def with_streaming_response(self) -> AsyncSnapshotResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, html: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -612,7 +610,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -743,11 +741,11 @@ async def create( """ ... - @required_args(["html"], ["url"]) + @required_args(["account_id", "html"], ["account_id", "url"]) async def create( self, *, - account_id: str | None = None, + account_id: str, html: str | Omit = omit, cache_ttl: float | Omit = omit, action_timeout: float | Omit = omit, @@ -835,8 +833,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/cache/__init__.py b/src/cloudflare/resources/cache/__init__.py index faa73ad7735..5b2d2fe4555 100644 --- a/src/cloudflare/resources/cache/__init__.py +++ b/src/cloudflare/resources/cache/__init__.py @@ -32,6 +32,14 @@ SmartTieredCacheResourceWithStreamingResponse, AsyncSmartTieredCacheResourceWithStreamingResponse, ) +from .origin_cloud_regions import ( + OriginCloudRegionsResource, + AsyncOriginCloudRegionsResource, + OriginCloudRegionsResourceWithRawResponse, + AsyncOriginCloudRegionsResourceWithRawResponse, + OriginCloudRegionsResourceWithStreamingResponse, + AsyncOriginCloudRegionsResourceWithStreamingResponse, +) from .regional_tiered_cache import ( RegionalTieredCacheResource, AsyncRegionalTieredCacheResource, @@ -66,6 +74,12 @@ "AsyncRegionalTieredCacheResourceWithRawResponse", "RegionalTieredCacheResourceWithStreamingResponse", "AsyncRegionalTieredCacheResourceWithStreamingResponse", + "OriginCloudRegionsResource", + "AsyncOriginCloudRegionsResource", + "OriginCloudRegionsResourceWithRawResponse", + "AsyncOriginCloudRegionsResourceWithRawResponse", + "OriginCloudRegionsResourceWithStreamingResponse", + "AsyncOriginCloudRegionsResourceWithStreamingResponse", "CacheResource", "AsyncCacheResource", "CacheResourceWithRawResponse", diff --git a/src/cloudflare/resources/cache/api.md b/src/cloudflare/resources/cache/api.md index aa7b9c376b3..3bbb74056ef 100644 --- a/src/cloudflare/resources/cache/api.md +++ b/src/cloudflare/resources/cache/api.md @@ -86,3 +86,32 @@ Methods: - client.cache.regional_tiered_cache.edit(\*, zone_id, \*\*params) -> Optional[RegionalTieredCacheEditResponse] - client.cache.regional_tiered_cache.get(\*, zone_id) -> Optional[RegionalTieredCacheGetResponse] + +## OriginCloudRegions + +Types: + +```python +from cloudflare.types.cache import ( + OriginCloudRegion, + OriginCloudRegionCreateResponse, + OriginCloudRegionListResponse, + OriginCloudRegionDeleteResponse, + OriginCloudRegionBulkDeleteResponse, + OriginCloudRegionBulkEditResponse, + OriginCloudRegionEditResponse, + OriginCloudRegionGetResponse, + OriginCloudRegionSupportedRegionsResponse, +) +``` + +Methods: + +- client.cache.origin_cloud_regions.create(\*, zone_id, \*\*params) -> Optional[OriginCloudRegionCreateResponse] +- client.cache.origin_cloud_regions.list(\*, zone_id) -> Optional[OriginCloudRegionListResponse] +- client.cache.origin_cloud_regions.delete(origin_ip, \*, zone_id) -> Optional[OriginCloudRegionDeleteResponse] +- client.cache.origin_cloud_regions.bulk_delete(\*, zone_id) -> Optional[OriginCloudRegionBulkDeleteResponse] +- client.cache.origin_cloud_regions.bulk_edit(\*, zone_id, \*\*params) -> Optional[OriginCloudRegionBulkEditResponse] +- client.cache.origin_cloud_regions.edit(\*, zone_id, \*\*params) -> Optional[OriginCloudRegionEditResponse] +- client.cache.origin_cloud_regions.get(origin_ip, \*, zone_id) -> Optional[OriginCloudRegionGetResponse] +- client.cache.origin_cloud_regions.supported_regions(\*, zone_id) -> Optional[OriginCloudRegionSupportedRegionsResponse] diff --git a/src/cloudflare/resources/cache/cache.py b/src/cloudflare/resources/cache/cache.py index 140c5cce06f..d6b1c0f7a0b 100644 --- a/src/cloudflare/resources/cache/cache.py +++ b/src/cloudflare/resources/cache/cache.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform from .variants import ( VariantsResource, AsyncVariantsResource, @@ -44,6 +44,14 @@ SmartTieredCacheResourceWithStreamingResponse, AsyncSmartTieredCacheResourceWithStreamingResponse, ) +from .origin_cloud_regions import ( + OriginCloudRegionsResource, + AsyncOriginCloudRegionsResource, + OriginCloudRegionsResourceWithRawResponse, + AsyncOriginCloudRegionsResourceWithRawResponse, + OriginCloudRegionsResourceWithStreamingResponse, + AsyncOriginCloudRegionsResourceWithStreamingResponse, +) from .regional_tiered_cache import ( RegionalTieredCacheResource, AsyncRegionalTieredCacheResource, @@ -74,6 +82,10 @@ def variants(self) -> VariantsResource: def regional_tiered_cache(self) -> RegionalTieredCacheResource: return RegionalTieredCacheResource(self._client) + @cached_property + def origin_cloud_regions(self) -> OriginCloudRegionsResource: + return OriginCloudRegionsResource(self._client) + @cached_property def with_raw_response(self) -> CacheResourceWithRawResponse: """ @@ -97,7 +109,7 @@ def with_streaming_response(self) -> CacheResourceWithStreamingResponse: def purge( self, *, - zone_id: str | None = None, + zone_id: str, tags: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -199,7 +211,7 @@ def purge( def purge( self, *, - zone_id: str | None = None, + zone_id: str, hosts: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -301,7 +313,7 @@ def purge( def purge( self, *, - zone_id: str | None = None, + zone_id: str, prefixes: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -403,7 +415,7 @@ def purge( def purge( self, *, - zone_id: str | None = None, + zone_id: str, purge_everything: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -505,7 +517,7 @@ def purge( def purge( self, *, - zone_id: str | None = None, + zone_id: str, files: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -607,7 +619,7 @@ def purge( def purge( self, *, - zone_id: str | None = None, + zone_id: str, files: Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -705,10 +717,11 @@ def purge( """ ... + @required_args(["zone_id"]) def purge( self, *, - zone_id: str | None = None, + zone_id: str, tags: SequenceNotStr[str] | Omit = omit, hosts: SequenceNotStr[str] | Omit = omit, prefixes: SequenceNotStr[str] | Omit = omit, @@ -723,8 +736,6 @@ def purge( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -767,6 +778,10 @@ def variants(self) -> AsyncVariantsResource: def regional_tiered_cache(self) -> AsyncRegionalTieredCacheResource: return AsyncRegionalTieredCacheResource(self._client) + @cached_property + def origin_cloud_regions(self) -> AsyncOriginCloudRegionsResource: + return AsyncOriginCloudRegionsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncCacheResourceWithRawResponse: """ @@ -790,7 +805,7 @@ def with_streaming_response(self) -> AsyncCacheResourceWithStreamingResponse: async def purge( self, *, - zone_id: str | None = None, + zone_id: str, tags: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -892,7 +907,7 @@ async def purge( async def purge( self, *, - zone_id: str | None = None, + zone_id: str, hosts: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -994,7 +1009,7 @@ async def purge( async def purge( self, *, - zone_id: str | None = None, + zone_id: str, prefixes: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1096,7 +1111,7 @@ async def purge( async def purge( self, *, - zone_id: str | None = None, + zone_id: str, purge_everything: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1198,7 +1213,7 @@ async def purge( async def purge( self, *, - zone_id: str | None = None, + zone_id: str, files: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1300,7 +1315,7 @@ async def purge( async def purge( self, *, - zone_id: str | None = None, + zone_id: str, files: Iterable[cache_purge_params.CachePurgeSingleFileWithURLAndHeadersFile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1398,10 +1413,11 @@ async def purge( """ ... + @required_args(["zone_id"]) async def purge( self, *, - zone_id: str | None = None, + zone_id: str, tags: SequenceNotStr[str] | Omit = omit, hosts: SequenceNotStr[str] | Omit = omit, prefixes: SequenceNotStr[str] | Omit = omit, @@ -1416,8 +1432,6 @@ async def purge( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CachePurgeResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -1467,6 +1481,10 @@ def variants(self) -> VariantsResourceWithRawResponse: def regional_tiered_cache(self) -> RegionalTieredCacheResourceWithRawResponse: return RegionalTieredCacheResourceWithRawResponse(self._cache.regional_tiered_cache) + @cached_property + def origin_cloud_regions(self) -> OriginCloudRegionsResourceWithRawResponse: + return OriginCloudRegionsResourceWithRawResponse(self._cache.origin_cloud_regions) + class AsyncCacheResourceWithRawResponse: def __init__(self, cache: AsyncCacheResource) -> None: @@ -1492,6 +1510,10 @@ def variants(self) -> AsyncVariantsResourceWithRawResponse: def regional_tiered_cache(self) -> AsyncRegionalTieredCacheResourceWithRawResponse: return AsyncRegionalTieredCacheResourceWithRawResponse(self._cache.regional_tiered_cache) + @cached_property + def origin_cloud_regions(self) -> AsyncOriginCloudRegionsResourceWithRawResponse: + return AsyncOriginCloudRegionsResourceWithRawResponse(self._cache.origin_cloud_regions) + class CacheResourceWithStreamingResponse: def __init__(self, cache: CacheResource) -> None: @@ -1517,6 +1539,10 @@ def variants(self) -> VariantsResourceWithStreamingResponse: def regional_tiered_cache(self) -> RegionalTieredCacheResourceWithStreamingResponse: return RegionalTieredCacheResourceWithStreamingResponse(self._cache.regional_tiered_cache) + @cached_property + def origin_cloud_regions(self) -> OriginCloudRegionsResourceWithStreamingResponse: + return OriginCloudRegionsResourceWithStreamingResponse(self._cache.origin_cloud_regions) + class AsyncCacheResourceWithStreamingResponse: def __init__(self, cache: AsyncCacheResource) -> None: @@ -1541,3 +1567,7 @@ def variants(self) -> AsyncVariantsResourceWithStreamingResponse: @cached_property def regional_tiered_cache(self) -> AsyncRegionalTieredCacheResourceWithStreamingResponse: return AsyncRegionalTieredCacheResourceWithStreamingResponse(self._cache.regional_tiered_cache) + + @cached_property + def origin_cloud_regions(self) -> AsyncOriginCloudRegionsResourceWithStreamingResponse: + return AsyncOriginCloudRegionsResourceWithStreamingResponse(self._cache.origin_cloud_regions) diff --git a/src/cloudflare/resources/cache/cache_reserve.py b/src/cloudflare/resources/cache/cache_reserve.py index e937dee80c0..4de5fadcc3f 100644 --- a/src/cloudflare/resources/cache/cache_reserve.py +++ b/src/cloudflare/resources/cache/cache_reserve.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> CacheReserveResourceWithStreamingResponse: def clear( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -77,8 +77,6 @@ def clear( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -97,7 +95,7 @@ def clear( def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,8 +125,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -147,7 +143,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -174,8 +170,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -193,7 +187,7 @@ def get( def status( self, *, - zone_id: str | None = None, + 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, @@ -218,8 +212,6 @@ def status( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -258,7 +250,7 @@ def with_streaming_response(self) -> AsyncCacheReserveResourceWithStreamingRespo async def clear( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -284,8 +276,6 @@ async def clear( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -304,7 +294,7 @@ async def clear( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -334,8 +324,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -354,7 +342,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -381,8 +369,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( @@ -400,7 +386,7 @@ async def get( async def status( self, *, - zone_id: str | None = None, + 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, @@ -425,8 +411,6 @@ async def status( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cache/origin_cloud_regions.py b/src/cloudflare/resources/cache/origin_cloud_regions.py new file mode 100644 index 00000000000..a961eecd1d0 --- /dev/null +++ b/src/cloudflare/resources/cache/origin_cloud_regions.py @@ -0,0 +1,1012 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, Optional, cast +from typing_extensions import Literal + +import httpx + +from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...types.cache import ( + origin_cloud_region_edit_params, + origin_cloud_region_create_params, + origin_cloud_region_bulk_edit_params, +) +from ..._base_client import make_request_options +from ...types.cache.origin_cloud_region_get_response import OriginCloudRegionGetResponse +from ...types.cache.origin_cloud_region_edit_response import OriginCloudRegionEditResponse +from ...types.cache.origin_cloud_region_list_response import OriginCloudRegionListResponse +from ...types.cache.origin_cloud_region_create_response import OriginCloudRegionCreateResponse +from ...types.cache.origin_cloud_region_delete_response import OriginCloudRegionDeleteResponse +from ...types.cache.origin_cloud_region_bulk_edit_response import OriginCloudRegionBulkEditResponse +from ...types.cache.origin_cloud_region_bulk_delete_response import OriginCloudRegionBulkDeleteResponse +from ...types.cache.origin_cloud_region_supported_regions_response import OriginCloudRegionSupportedRegionsResponse + +__all__ = ["OriginCloudRegionsResource", "AsyncOriginCloudRegionsResource"] + + +class OriginCloudRegionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> OriginCloudRegionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return OriginCloudRegionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OriginCloudRegionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return OriginCloudRegionsResourceWithStreamingResponse(self) + + def create( + self, + *, + zone_id: str, + ip: str, + region: str, + vendor: Literal["aws", "azure", "gcp", "oci"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionCreateResponse]: + """Adds a single IP-to-cloud-region mapping for the zone. + + The IP must be a valid + IPv4 or IPv6 address and is normalized to canonical form before storage (RFC + 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists + — use PATCH to update an existing entry. The vendor and region are validated + against the list from + `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + + Args: + zone_id: Identifier. + + ip: Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage + (RFC 5952 for IPv6). + + region: Cloud vendor region identifier. Must be a valid region for the specified vendor + as returned by the supported_regions endpoint. + + vendor: Cloud vendor hosting the origin. Must be one of the supported vendors. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + body=maybe_transform( + { + "ip": ip, + "region": region, + "vendor": vendor, + }, + origin_cloud_region_create_params.OriginCloudRegionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionCreateResponse]], ResultWrapper[OriginCloudRegionCreateResponse] + ), + ) + + def list( + 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, + ) -> Optional[OriginCloudRegionListResponse]: + """Returns all IP-to-cloud-region mappings configured for the zone. + + Each mapping + tells Cloudflare which cloud vendor and region hosts the origin at that IP, + enabling the edge to route via the nearest Tiered Cache upper-tier co-located + with that cloud provider. Returns an empty array when no mappings exist. + + 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._get( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionListResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionListResponse]], ResultWrapper[OriginCloudRegionListResponse]), + ) + + def delete( + self, + origin_ip: 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[OriginCloudRegionDeleteResponse]: + """Removes the cloud region mapping for a single origin IP address. + + The IP path + parameter is normalized before lookup. Returns the deleted entry on success. + Returns 404 (code 1163) if no mapping exists for the specified IP. When the last + mapping for the zone is removed the underlying rule record is also deleted. + + 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}") + if not origin_ip: + raise ValueError(f"Expected a non-empty value for `origin_ip` but received {origin_ip!r}") + return self._delete( + path_template( + "/zones/{zone_id}/cache/origin_cloud_regions/{origin_ip}", zone_id=zone_id, origin_ip=origin_ip + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionDeleteResponse]], ResultWrapper[OriginCloudRegionDeleteResponse] + ), + ) + + def bulk_delete( + 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, + ) -> Optional[OriginCloudRegionBulkDeleteResponse]: + """Removes up to 100 IP-to-cloud-region mappings in a single request. + + Each IP is + validated independently — successfully deleted items are returned in the + `succeeded` array and IPs that could not be found or are invalid are returned in + the `failed` array. + + 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._delete( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/batch", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionBulkDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionBulkDeleteResponse]], ResultWrapper[OriginCloudRegionBulkDeleteResponse] + ), + ) + + def bulk_edit( + self, + *, + zone_id: str, + body: Iterable[origin_cloud_region_bulk_edit_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionBulkEditResponse]: + """Adds or updates up to 100 IP-to-cloud-region mappings in a single request. + + Each + item is validated independently — valid items are applied and invalid items are + returned in the `failed` array. The vendor and region for every item are + validated against the list from + `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + + 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._patch( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/batch", zone_id=zone_id), + body=maybe_transform(body, Iterable[origin_cloud_region_bulk_edit_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionBulkEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionBulkEditResponse]], ResultWrapper[OriginCloudRegionBulkEditResponse] + ), + ) + + def edit( + self, + *, + zone_id: str, + ip: str, + region: str, + vendor: Literal["aws", "azure", "gcp", "oci"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionEditResponse]: + """Adds or updates a single IP-to-cloud-region mapping for the zone. + + Unlike POST, + this operation is idempotent — if a mapping for the IP already exists it is + overwritten. Returns the complete updated list of all mappings for the zone. + Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP + mappings. + + Args: + zone_id: Identifier. + + ip: Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage + (RFC 5952 for IPv6). + + region: Cloud vendor region identifier. Must be a valid region for the specified vendor + as returned by the supported_regions endpoint. + + vendor: Cloud vendor hosting the origin. Must be one of the supported vendors. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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._patch( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + body=maybe_transform( + { + "ip": ip, + "region": region, + "vendor": vendor, + }, + origin_cloud_region_edit_params.OriginCloudRegionEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionEditResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionEditResponse]], ResultWrapper[OriginCloudRegionEditResponse]), + ) + + def get( + self, + origin_ip: 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[OriginCloudRegionGetResponse]: + """Returns the cloud region mapping for a single origin IP address. + + The IP path + parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 + (code 1142) if the zone has no mappings or if the specified IP has no mapping. + + 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}") + if not origin_ip: + raise ValueError(f"Expected a non-empty value for `origin_ip` but received {origin_ip!r}") + return self._get( + path_template( + "/zones/{zone_id}/cache/origin_cloud_regions/{origin_ip}", zone_id=zone_id, origin_ip=origin_ip + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionGetResponse]], ResultWrapper[OriginCloudRegionGetResponse]), + ) + + def supported_regions( + 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, + ) -> Optional[OriginCloudRegionSupportedRegionsResponse]: + """ + Returns the cloud vendors and regions that are valid values for origin cloud + region mappings. Each region includes the Tiered Cache upper-tier colocation + codes that will be used for cache routing when a mapping targeting that region + is active. Requires the zone to have Tiered Cache enabled. + + 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._get( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/supported_regions", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionSupportedRegionsResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionSupportedRegionsResponse]], + ResultWrapper[OriginCloudRegionSupportedRegionsResponse], + ), + ) + + +class AsyncOriginCloudRegionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncOriginCloudRegionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncOriginCloudRegionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOriginCloudRegionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncOriginCloudRegionsResourceWithStreamingResponse(self) + + async def create( + self, + *, + zone_id: str, + ip: str, + region: str, + vendor: Literal["aws", "azure", "gcp", "oci"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionCreateResponse]: + """Adds a single IP-to-cloud-region mapping for the zone. + + The IP must be a valid + IPv4 or IPv6 address and is normalized to canonical form before storage (RFC + 5952 for IPv6). Returns 400 (code 1145) if a mapping for that IP already exists + — use PATCH to update an existing entry. The vendor and region are validated + against the list from + `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + + Args: + zone_id: Identifier. + + ip: Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage + (RFC 5952 for IPv6). + + region: Cloud vendor region identifier. Must be a valid region for the specified vendor + as returned by the supported_regions endpoint. + + vendor: Cloud vendor hosting the origin. Must be one of the supported vendors. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 await self._post( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + body=await async_maybe_transform( + { + "ip": ip, + "region": region, + "vendor": vendor, + }, + origin_cloud_region_create_params.OriginCloudRegionCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionCreateResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionCreateResponse]], ResultWrapper[OriginCloudRegionCreateResponse] + ), + ) + + async def list( + 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, + ) -> Optional[OriginCloudRegionListResponse]: + """Returns all IP-to-cloud-region mappings configured for the zone. + + Each mapping + tells Cloudflare which cloud vendor and region hosts the origin at that IP, + enabling the edge to route via the nearest Tiered Cache upper-tier co-located + with that cloud provider. Returns an empty array when no mappings exist. + + 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 await self._get( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionListResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionListResponse]], ResultWrapper[OriginCloudRegionListResponse]), + ) + + async def delete( + self, + origin_ip: 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[OriginCloudRegionDeleteResponse]: + """Removes the cloud region mapping for a single origin IP address. + + The IP path + parameter is normalized before lookup. Returns the deleted entry on success. + Returns 404 (code 1163) if no mapping exists for the specified IP. When the last + mapping for the zone is removed the underlying rule record is also deleted. + + 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}") + if not origin_ip: + raise ValueError(f"Expected a non-empty value for `origin_ip` but received {origin_ip!r}") + return await self._delete( + path_template( + "/zones/{zone_id}/cache/origin_cloud_regions/{origin_ip}", zone_id=zone_id, origin_ip=origin_ip + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionDeleteResponse]], ResultWrapper[OriginCloudRegionDeleteResponse] + ), + ) + + async def bulk_delete( + 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, + ) -> Optional[OriginCloudRegionBulkDeleteResponse]: + """Removes up to 100 IP-to-cloud-region mappings in a single request. + + Each IP is + validated independently — successfully deleted items are returned in the + `succeeded` array and IPs that could not be found or are invalid are returned in + the `failed` array. + + 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 await self._delete( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/batch", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionBulkDeleteResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionBulkDeleteResponse]], ResultWrapper[OriginCloudRegionBulkDeleteResponse] + ), + ) + + async def bulk_edit( + self, + *, + zone_id: str, + body: Iterable[origin_cloud_region_bulk_edit_params.Body], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionBulkEditResponse]: + """Adds or updates up to 100 IP-to-cloud-region mappings in a single request. + + Each + item is validated independently — valid items are applied and invalid items are + returned in the `failed` array. The vendor and region for every item are + validated against the list from + `GET /zones/{zone_id}/cache/origin_cloud_regions/supported_regions`. + + 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 await self._patch( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/batch", zone_id=zone_id), + body=await async_maybe_transform(body, Iterable[origin_cloud_region_bulk_edit_params.Body]), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionBulkEditResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionBulkEditResponse]], ResultWrapper[OriginCloudRegionBulkEditResponse] + ), + ) + + async def edit( + self, + *, + zone_id: str, + ip: str, + region: str, + vendor: Literal["aws", "azure", "gcp", "oci"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCloudRegionEditResponse]: + """Adds or updates a single IP-to-cloud-region mapping for the zone. + + Unlike POST, + this operation is idempotent — if a mapping for the IP already exists it is + overwritten. Returns the complete updated list of all mappings for the zone. + Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP + mappings. + + Args: + zone_id: Identifier. + + ip: Origin IP address (IPv4 or IPv6). Normalized to canonical form before storage + (RFC 5952 for IPv6). + + region: Cloud vendor region identifier. Must be a valid region for the specified vendor + as returned by the supported_regions endpoint. + + vendor: Cloud vendor hosting the origin. Must be one of the supported vendors. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 await self._patch( + path_template("/zones/{zone_id}/cache/origin_cloud_regions", zone_id=zone_id), + body=await async_maybe_transform( + { + "ip": ip, + "region": region, + "vendor": vendor, + }, + origin_cloud_region_edit_params.OriginCloudRegionEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionEditResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionEditResponse]], ResultWrapper[OriginCloudRegionEditResponse]), + ) + + async def get( + self, + origin_ip: 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[OriginCloudRegionGetResponse]: + """Returns the cloud region mapping for a single origin IP address. + + The IP path + parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 + (code 1142) if the zone has no mappings or if the specified IP has no mapping. + + 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}") + if not origin_ip: + raise ValueError(f"Expected a non-empty value for `origin_ip` but received {origin_ip!r}") + return await self._get( + path_template( + "/zones/{zone_id}/cache/origin_cloud_regions/{origin_ip}", zone_id=zone_id, origin_ip=origin_ip + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[OriginCloudRegionGetResponse]], ResultWrapper[OriginCloudRegionGetResponse]), + ) + + async def supported_regions( + 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, + ) -> Optional[OriginCloudRegionSupportedRegionsResponse]: + """ + Returns the cloud vendors and regions that are valid values for origin cloud + region mappings. Each region includes the Tiered Cache upper-tier colocation + codes that will be used for cache routing when a mapping targeting that region + is active. Requires the zone to have Tiered Cache enabled. + + 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 await self._get( + path_template("/zones/{zone_id}/cache/origin_cloud_regions/supported_regions", zone_id=zone_id), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[OriginCloudRegionSupportedRegionsResponse]]._unwrapper, + ), + cast_to=cast( + Type[Optional[OriginCloudRegionSupportedRegionsResponse]], + ResultWrapper[OriginCloudRegionSupportedRegionsResponse], + ), + ) + + +class OriginCloudRegionsResourceWithRawResponse: + def __init__(self, origin_cloud_regions: OriginCloudRegionsResource) -> None: + self._origin_cloud_regions = origin_cloud_regions + + self.create = to_raw_response_wrapper( + origin_cloud_regions.create, + ) + self.list = to_raw_response_wrapper( + origin_cloud_regions.list, + ) + self.delete = to_raw_response_wrapper( + origin_cloud_regions.delete, + ) + self.bulk_delete = to_raw_response_wrapper( + origin_cloud_regions.bulk_delete, + ) + self.bulk_edit = to_raw_response_wrapper( + origin_cloud_regions.bulk_edit, + ) + self.edit = to_raw_response_wrapper( + origin_cloud_regions.edit, + ) + self.get = to_raw_response_wrapper( + origin_cloud_regions.get, + ) + self.supported_regions = to_raw_response_wrapper( + origin_cloud_regions.supported_regions, + ) + + +class AsyncOriginCloudRegionsResourceWithRawResponse: + def __init__(self, origin_cloud_regions: AsyncOriginCloudRegionsResource) -> None: + self._origin_cloud_regions = origin_cloud_regions + + self.create = async_to_raw_response_wrapper( + origin_cloud_regions.create, + ) + self.list = async_to_raw_response_wrapper( + origin_cloud_regions.list, + ) + self.delete = async_to_raw_response_wrapper( + origin_cloud_regions.delete, + ) + self.bulk_delete = async_to_raw_response_wrapper( + origin_cloud_regions.bulk_delete, + ) + self.bulk_edit = async_to_raw_response_wrapper( + origin_cloud_regions.bulk_edit, + ) + self.edit = async_to_raw_response_wrapper( + origin_cloud_regions.edit, + ) + self.get = async_to_raw_response_wrapper( + origin_cloud_regions.get, + ) + self.supported_regions = async_to_raw_response_wrapper( + origin_cloud_regions.supported_regions, + ) + + +class OriginCloudRegionsResourceWithStreamingResponse: + def __init__(self, origin_cloud_regions: OriginCloudRegionsResource) -> None: + self._origin_cloud_regions = origin_cloud_regions + + self.create = to_streamed_response_wrapper( + origin_cloud_regions.create, + ) + self.list = to_streamed_response_wrapper( + origin_cloud_regions.list, + ) + self.delete = to_streamed_response_wrapper( + origin_cloud_regions.delete, + ) + self.bulk_delete = to_streamed_response_wrapper( + origin_cloud_regions.bulk_delete, + ) + self.bulk_edit = to_streamed_response_wrapper( + origin_cloud_regions.bulk_edit, + ) + self.edit = to_streamed_response_wrapper( + origin_cloud_regions.edit, + ) + self.get = to_streamed_response_wrapper( + origin_cloud_regions.get, + ) + self.supported_regions = to_streamed_response_wrapper( + origin_cloud_regions.supported_regions, + ) + + +class AsyncOriginCloudRegionsResourceWithStreamingResponse: + def __init__(self, origin_cloud_regions: AsyncOriginCloudRegionsResource) -> None: + self._origin_cloud_regions = origin_cloud_regions + + self.create = async_to_streamed_response_wrapper( + origin_cloud_regions.create, + ) + self.list = async_to_streamed_response_wrapper( + origin_cloud_regions.list, + ) + self.delete = async_to_streamed_response_wrapper( + origin_cloud_regions.delete, + ) + self.bulk_delete = async_to_streamed_response_wrapper( + origin_cloud_regions.bulk_delete, + ) + self.bulk_edit = async_to_streamed_response_wrapper( + origin_cloud_regions.bulk_edit, + ) + self.edit = async_to_streamed_response_wrapper( + origin_cloud_regions.edit, + ) + self.get = async_to_streamed_response_wrapper( + origin_cloud_regions.get, + ) + self.supported_regions = async_to_streamed_response_wrapper( + origin_cloud_regions.supported_regions, + ) diff --git a/src/cloudflare/resources/cache/regional_tiered_cache.py b/src/cloudflare/resources/cache/regional_tiered_cache.py index 50c9c874555..f254f7b9873 100644 --- a/src/cloudflare/resources/cache/regional_tiered_cache.py +++ b/src/cloudflare/resources/cache/regional_tiered_cache.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> RegionalTieredCacheResourceWithStreamingRes def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -98,7 +96,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -122,8 +120,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -162,7 +158,7 @@ def with_streaming_response(self) -> AsyncRegionalTieredCacheResourceWithStreami async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -189,8 +185,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -213,7 +207,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -237,8 +231,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cache/smart_tiered_cache.py b/src/cloudflare/resources/cache/smart_tiered_cache.py index 0542a3dff65..ce23d7d3c3e 100644 --- a/src/cloudflare/resources/cache/smart_tiered_cache.py +++ b/src/cloudflare/resources/cache/smart_tiered_cache.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> SmartTieredCacheResourceWithStreamingRespon def delete( self, *, - zone_id: str | None = None, + 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, @@ -77,8 +77,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -96,7 +94,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -126,8 +124,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -146,7 +142,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -173,8 +169,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -213,7 +207,7 @@ def with_streaming_response(self) -> AsyncSmartTieredCacheResourceWithStreamingR async def delete( self, *, - zone_id: str | None = None, + 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, @@ -240,8 +234,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -259,7 +251,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["on", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -289,8 +281,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -311,7 +301,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -338,8 +328,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cache/variants.py b/src/cloudflare/resources/cache/variants.py index e9c160ae31c..398394c9307 100644 --- a/src/cloudflare/resources/cache/variants.py +++ b/src/cloudflare/resources/cache/variants.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> VariantsResourceWithStreamingResponse: def delete( self, *, - zone_id: str | None = None, + 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, @@ -75,8 +75,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -94,7 +92,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: variant_edit_params.Value, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -123,8 +121,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -143,7 +139,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -169,8 +165,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -209,7 +203,7 @@ def with_streaming_response(self) -> AsyncVariantsResourceWithStreamingResponse: async def delete( self, *, - zone_id: str | None = None, + 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, @@ -235,8 +229,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -254,7 +246,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, value: variant_edit_params.Value, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -283,8 +275,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -303,7 +293,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -329,8 +319,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/calls/sfu.py b/src/cloudflare/resources/calls/sfu.py index 9898a2c3d6b..210ed0b2c4b 100644 --- a/src/cloudflare/resources/calls/sfu.py +++ b/src/cloudflare/resources/calls/sfu.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> SFUResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -100,7 +98,7 @@ def update( self, app_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,8 +125,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -149,7 +145,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -171,8 +167,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +182,7 @@ def delete( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -212,8 +206,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -234,7 +226,7 @@ def get( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -258,8 +250,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -300,7 +290,7 @@ def with_streaming_response(self) -> AsyncSFUResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -327,8 +317,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -348,7 +336,7 @@ async def update( self, app_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -375,8 +363,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -397,7 +383,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -419,8 +405,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -436,7 +420,7 @@ async def delete( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -460,8 +444,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -482,7 +464,7 @@ async def get( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -506,8 +488,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/calls/turn.py b/src/cloudflare/resources/calls/turn.py index 06ec7497e05..96a4c4f8ea0 100644 --- a/src/cloudflare/resources/calls/turn.py +++ b/src/cloudflare/resources/calls/turn.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> TURNResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -98,7 +96,7 @@ def update( self, key_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -125,8 +123,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: @@ -147,7 +143,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -169,8 +165,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -186,7 +180,7 @@ def delete( self, key_id: str, *, - account_id: str | None = None, + account_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, @@ -210,8 +204,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: @@ -232,7 +224,7 @@ def get( self, key_id: str, *, - account_id: str | None = None, + account_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, @@ -256,8 +248,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: @@ -298,7 +288,7 @@ def with_streaming_response(self) -> AsyncTURNResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -323,8 +313,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -344,7 +332,7 @@ async def update( self, key_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -371,8 +359,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: @@ -393,7 +379,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -415,8 +401,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -432,7 +416,7 @@ async def delete( self, key_id: str, *, - account_id: str | None = None, + account_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, @@ -456,8 +440,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: @@ -478,7 +460,7 @@ async def get( self, key_id: str, *, - account_id: str | None = None, + account_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, @@ -502,8 +484,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not key_id: diff --git a/src/cloudflare/resources/certificate_authorities/hostname_associations.py b/src/cloudflare/resources/certificate_authorities/hostname_associations.py index 8ae6c3e093e..8eb260f9af5 100644 --- a/src/cloudflare/resources/certificate_authorities/hostname_associations.py +++ b/src/cloudflare/resources/certificate_authorities/hostname_associations.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> HostnameAssociationsResourceWithStreamingRe def update( self, *, - zone_id: str | None = None, + zone_id: str, hostnames: SequenceNotStr[HostnameAssociation] | Omit = omit, mtls_certificate_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -105,7 +103,7 @@ def update( def get( self, *, - zone_id: str | None = None, + zone_id: str, mtls_certificate_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -132,8 +130,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -176,7 +172,7 @@ def with_streaming_response(self) -> AsyncHostnameAssociationsResourceWithStream async def update( self, *, - zone_id: str | None = None, + zone_id: str, hostnames: SequenceNotStr[HostnameAssociation] | Omit = omit, mtls_certificate_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -204,8 +200,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -232,7 +226,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + zone_id: str, mtls_certificate_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -259,8 +253,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/client_certificates.py b/src/cloudflare/resources/client_certificates.py deleted file mode 100644 index 3a347848901..00000000000 --- a/src/cloudflare/resources/client_certificates.py +++ /dev/null @@ -1,678 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.client_certificates import ( - client_certificate_edit_params, - client_certificate_list_params, - client_certificate_create_params, -) -from ..types.client_certificates.client_certificate import ClientCertificate - -__all__ = ["ClientCertificatesResource", "AsyncClientCertificatesResource"] - - -class ClientCertificatesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ClientCertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ClientCertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ClientCertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ClientCertificatesResourceWithStreamingResponse(self) - - def create( - self, - *, - zone_id: str, - csr: str, - validity_days: int, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate]: - """ - Create a new API Shield mTLS Client Certificate - - Args: - zone_id: Identifier. - - csr: The Certificate Signing Request (CSR). Must be newline-encoded. - - validity_days: The number of days the Client Certificate will be valid after the issued_on date - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/client_certificates", - body=maybe_transform( - { - "csr": csr, - "validity_days": validity_days, - }, - client_certificate_create_params.ClientCertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - def list( - self, - *, - zone_id: str, - limit: int | Omit = omit, - offset: int | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - status: Literal["all", "active", "pending_reactivation", "pending_revocation", "revoked"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate]: - """ - List all of your Zone's API Shield mTLS Client Certificates by Status and/or - using Pagination - - Args: - zone_id: Identifier. - - limit: Limit to the number of records returned. - - offset: Offset the results - - page: Page number of paginated results. - - per_page: Number of records per page. - - status: Client Certitifcate Status to filter results by. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/client_certificates", - page=SyncV4PagePaginationArray[ClientCertificate], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "offset": offset, - "page": page, - "per_page": per_page, - "status": status, - }, - client_certificate_list_params.ClientCertificateListParams, - ), - ), - model=ClientCertificate, - ) - - def delete( - self, - client_certificate_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[ClientCertificate]: - """ - Set a API Shield mTLS Client Certificate to pending_revocation status for - processing to revoked status. - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return self._delete( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - def edit( - self, - client_certificate_id: str, - *, - zone_id: str, - reactivate: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate]: - """ - If a API Shield mTLS Client Certificate is in a pending_revocation state, you - may reactivate it with this endpoint. - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return self._patch( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - body=maybe_transform( - {"reactivate": reactivate}, client_certificate_edit_params.ClientCertificateEditParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - def get( - self, - client_certificate_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[ClientCertificate]: - """ - Get Details for a single mTLS API Shield Client Certificate - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return self._get( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - -class AsyncClientCertificatesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncClientCertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncClientCertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncClientCertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncClientCertificatesResourceWithStreamingResponse(self) - - async def create( - self, - *, - zone_id: str, - csr: str, - validity_days: int, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate]: - """ - Create a new API Shield mTLS Client Certificate - - Args: - zone_id: Identifier. - - csr: The Certificate Signing Request (CSR). Must be newline-encoded. - - validity_days: The number of days the Client Certificate will be valid after the issued_on date - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._post( - f"/zones/{zone_id}/client_certificates", - body=await async_maybe_transform( - { - "csr": csr, - "validity_days": validity_days, - }, - client_certificate_create_params.ClientCertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - def list( - self, - *, - zone_id: str, - limit: int | Omit = omit, - offset: int | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - status: Literal["all", "active", "pending_reactivation", "pending_revocation", "revoked"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate, AsyncV4PagePaginationArray[ClientCertificate]]: - """ - List all of your Zone's API Shield mTLS Client Certificates by Status and/or - using Pagination - - Args: - zone_id: Identifier. - - limit: Limit to the number of records returned. - - offset: Offset the results - - page: Page number of paginated results. - - per_page: Number of records per page. - - status: Client Certitifcate Status to filter results by. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/client_certificates", - page=AsyncV4PagePaginationArray[ClientCertificate], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "offset": offset, - "page": page, - "per_page": per_page, - "status": status, - }, - client_certificate_list_params.ClientCertificateListParams, - ), - ), - model=ClientCertificate, - ) - - async def delete( - self, - client_certificate_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[ClientCertificate]: - """ - Set a API Shield mTLS Client Certificate to pending_revocation status for - processing to revoked status. - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return await self._delete( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - async def edit( - self, - client_certificate_id: str, - *, - zone_id: str, - reactivate: bool | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[ClientCertificate]: - """ - If a API Shield mTLS Client Certificate is in a pending_revocation state, you - may reactivate it with this endpoint. - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return await self._patch( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - body=await async_maybe_transform( - {"reactivate": reactivate}, client_certificate_edit_params.ClientCertificateEditParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - async def get( - self, - client_certificate_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[ClientCertificate]: - """ - Get Details for a single mTLS API Shield Client Certificate - - Args: - zone_id: Identifier. - - client_certificate_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 client_certificate_id: - raise ValueError( - f"Expected a non-empty value for `client_certificate_id` but received {client_certificate_id!r}" - ) - return await self._get( - f"/zones/{zone_id}/client_certificates/{client_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[ClientCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[ClientCertificate]], ResultWrapper[ClientCertificate]), - ) - - -class ClientCertificatesResourceWithRawResponse: - def __init__(self, client_certificates: ClientCertificatesResource) -> None: - self._client_certificates = client_certificates - - self.create = to_raw_response_wrapper( - client_certificates.create, - ) - self.list = to_raw_response_wrapper( - client_certificates.list, - ) - self.delete = to_raw_response_wrapper( - client_certificates.delete, - ) - self.edit = to_raw_response_wrapper( - client_certificates.edit, - ) - self.get = to_raw_response_wrapper( - client_certificates.get, - ) - - -class AsyncClientCertificatesResourceWithRawResponse: - def __init__(self, client_certificates: AsyncClientCertificatesResource) -> None: - self._client_certificates = client_certificates - - self.create = async_to_raw_response_wrapper( - client_certificates.create, - ) - self.list = async_to_raw_response_wrapper( - client_certificates.list, - ) - self.delete = async_to_raw_response_wrapper( - client_certificates.delete, - ) - self.edit = async_to_raw_response_wrapper( - client_certificates.edit, - ) - self.get = async_to_raw_response_wrapper( - client_certificates.get, - ) - - -class ClientCertificatesResourceWithStreamingResponse: - def __init__(self, client_certificates: ClientCertificatesResource) -> None: - self._client_certificates = client_certificates - - self.create = to_streamed_response_wrapper( - client_certificates.create, - ) - self.list = to_streamed_response_wrapper( - client_certificates.list, - ) - self.delete = to_streamed_response_wrapper( - client_certificates.delete, - ) - self.edit = to_streamed_response_wrapper( - client_certificates.edit, - ) - self.get = to_streamed_response_wrapper( - client_certificates.get, - ) - - -class AsyncClientCertificatesResourceWithStreamingResponse: - def __init__(self, client_certificates: AsyncClientCertificatesResource) -> None: - self._client_certificates = client_certificates - - self.create = async_to_streamed_response_wrapper( - client_certificates.create, - ) - self.list = async_to_streamed_response_wrapper( - client_certificates.list, - ) - self.delete = async_to_streamed_response_wrapper( - client_certificates.delete, - ) - self.edit = async_to_streamed_response_wrapper( - client_certificates.edit, - ) - self.get = async_to_streamed_response_wrapper( - client_certificates.get, - ) diff --git a/src/cloudflare/resources/client_certificates/client_certificates.py b/src/cloudflare/resources/client_certificates/client_certificates.py index a864d12bdda..bd87f1127f5 100644 --- a/src/cloudflare/resources/client_certificates/client_certificates.py +++ b/src/cloudflare/resources/client_certificates/client_certificates.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> ClientCertificatesResourceWithStreamingResp def create( self, *, - zone_id: str | None = None, + zone_id: str, csr: str, validity_days: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -81,8 +81,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -107,7 +105,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, page: float | Omit = omit, @@ -145,8 +143,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -175,7 +171,7 @@ def delete( self, client_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -200,8 +196,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: @@ -228,7 +222,7 @@ def edit( self, client_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, reactivate: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -254,8 +248,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: @@ -285,7 +277,7 @@ def get( self, client_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -309,8 +301,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: @@ -357,7 +347,7 @@ def with_streaming_response(self) -> AsyncClientCertificatesResourceWithStreamin async def create( self, *, - zone_id: str | None = None, + zone_id: str, csr: str, validity_days: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -385,8 +375,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -411,7 +399,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, page: float | Omit = omit, @@ -449,8 +437,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -479,7 +465,7 @@ async def delete( self, client_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -504,8 +490,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: @@ -532,7 +516,7 @@ async def edit( self, client_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, reactivate: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -558,8 +542,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: @@ -589,7 +571,7 @@ async def get( self, client_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -613,8 +595,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not client_certificate_id: diff --git a/src/cloudflare/resources/cloud_connector/rules.py b/src/cloudflare/resources/cloud_connector/rules.py index a66d2107730..1c074027ebb 100644 --- a/src/cloudflare/resources/cloud_connector/rules.py +++ b/src/cloudflare/resources/cloud_connector/rules.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -89,7 +87,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -111,8 +109,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -148,7 +144,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -171,8 +167,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -189,7 +183,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -211,8 +205,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/cloudforce_one/binary_storage.py b/src/cloudflare/resources/cloudforce_one/binary_storage.py index 74c98d84c2a..8f79848aea8 100644 --- a/src/cloudflare/resources/cloudforce_one/binary_storage.py +++ b/src/cloudflare/resources/cloudforce_one/binary_storage.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> BinaryStorageResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, file: 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. @@ -71,8 +71,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") body = deepcopy_minimal({"file": file}) @@ -95,7 +93,7 @@ def get( self, hash: str, *, - account_id: str | None = None, + account_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, @@ -119,8 +117,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hash: @@ -158,7 +154,7 @@ def with_streaming_response(self) -> AsyncBinaryStorageResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, file: 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. @@ -183,8 +179,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") body = deepcopy_minimal({"file": file}) @@ -207,7 +201,7 @@ async def get( self, hash: str, *, - account_id: str | None = None, + account_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, @@ -231,8 +225,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hash: diff --git a/src/cloudflare/resources/cloudforce_one/requests/assets.py b/src/cloudflare/resources/cloudforce_one/requests/assets.py index 2537b2beaee..161bff746f4 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/assets.py +++ b/src/cloudflare/resources/cloudforce_one/requests/assets.py @@ -52,7 +52,7 @@ def create( self, request_id: str, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -113,7 +111,7 @@ def update( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_id: str, source: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -143,8 +141,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -173,7 +169,7 @@ def delete( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_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. @@ -200,8 +196,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -225,7 +219,7 @@ def get( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_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. @@ -252,8 +246,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -299,7 +291,7 @@ def create( self, request_id: str, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -329,8 +321,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -360,7 +350,7 @@ async def update( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_id: str, source: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -390,8 +380,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -420,7 +408,7 @@ async def delete( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_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. @@ -447,8 +435,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -472,7 +458,7 @@ def get( self, asset_id: str, *, - account_id: str | None = None, + account_id: str, request_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. @@ -499,8 +485,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: diff --git a/src/cloudflare/resources/cloudforce_one/requests/message.py b/src/cloudflare/resources/cloudforce_one/requests/message.py index 36a6cd9b811..ee94c222e56 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/message.py +++ b/src/cloudflare/resources/cloudforce_one/requests/message.py @@ -52,7 +52,7 @@ def create( self, request_id: str, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -106,7 +104,7 @@ def update( self, message_id: int, *, - account_id: str | None = None, + account_id: str, request_id: str, content: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -134,8 +132,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -162,7 +158,7 @@ def delete( self, message_id: int, *, - account_id: str | None = None, + account_id: str, request_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. @@ -187,8 +183,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -210,7 +204,7 @@ def get( self, request_id: str, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, after: Union[str, datetime] | Omit = omit, @@ -252,8 +246,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -308,7 +300,7 @@ async def create( self, request_id: str, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -335,8 +327,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -362,7 +352,7 @@ async def update( self, message_id: int, *, - account_id: str | None = None, + account_id: str, request_id: str, content: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -390,8 +380,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -418,7 +406,7 @@ async def delete( self, message_id: int, *, - account_id: str | None = None, + account_id: str, request_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. @@ -443,8 +431,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -466,7 +452,7 @@ def get( self, request_id: str, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, after: Union[str, datetime] | Omit = omit, @@ -508,8 +494,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: diff --git a/src/cloudflare/resources/cloudforce_one/requests/priority.py b/src/cloudflare/resources/cloudforce_one/requests/priority.py index 2ef99cda698..7cc91c98153 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/priority.py +++ b/src/cloudflare/resources/cloudforce_one/requests/priority.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> PriorityResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, labels: SequenceNotStr[Label], priority: int, requirement: str, @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -115,7 +113,7 @@ def update( self, priority_id: str, *, - account_id: str | None = None, + account_id: str, labels: SequenceNotStr[Label], priority: int, requirement: str, @@ -151,8 +149,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -186,7 +182,7 @@ def delete( self, priority_id: str, *, - account_id: str | None = None, + account_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, @@ -210,8 +206,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -232,7 +226,7 @@ def get( self, priority_id: str, *, - account_id: str | None = None, + account_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, @@ -256,8 +250,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -281,7 +273,7 @@ def get( def quota( self, *, - account_id: str | None = None, + account_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, @@ -303,8 +295,6 @@ def quota( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -343,7 +333,7 @@ def with_streaming_response(self) -> AsyncPriorityResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, labels: SequenceNotStr[Label], priority: int, requirement: str, @@ -377,8 +367,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -406,7 +394,7 @@ async def update( self, priority_id: str, *, - account_id: str | None = None, + account_id: str, labels: SequenceNotStr[Label], priority: int, requirement: str, @@ -442,8 +430,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -477,7 +463,7 @@ async def delete( self, priority_id: str, *, - account_id: str | None = None, + account_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, @@ -501,8 +487,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -523,7 +507,7 @@ async def get( self, priority_id: str, *, - account_id: str | None = None, + account_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, @@ -547,8 +531,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not priority_id: @@ -572,7 +554,7 @@ async def get( async def quota( self, *, - account_id: str | None = None, + account_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, @@ -594,8 +576,6 @@ async def quota( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/requests/requests.py b/src/cloudflare/resources/cloudforce_one/requests/requests.py index ce5d1b7d0a7..c48429be15d 100644 --- a/src/cloudflare/resources/cloudforce_one/requests/requests.py +++ b/src/cloudflare/resources/cloudforce_one/requests/requests.py @@ -91,7 +91,7 @@ def with_streaming_response(self) -> RequestsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, priority: str | Omit = omit, request_type: str | Omit = omit, @@ -130,8 +130,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -160,7 +158,7 @@ def update( self, request_id: str, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, priority: str | Omit = omit, request_type: str | Omit = omit, @@ -202,8 +200,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -237,7 +233,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, completed_after: Union[str, datetime] | Omit = omit, @@ -289,8 +285,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -322,7 +316,7 @@ def delete( self, request_id: str, *, - account_id: str | None = None, + account_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, @@ -346,8 +340,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -367,7 +359,7 @@ def delete( def constants( self, *, - account_id: str | None = None, + account_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, @@ -390,8 +382,6 @@ def constants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -410,7 +400,7 @@ def get( self, request_id: str, *, - account_id: str | None = None, + account_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, @@ -434,8 +424,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -459,7 +447,7 @@ def get( def quota( self, *, - account_id: str | None = None, + account_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, @@ -481,8 +469,6 @@ def quota( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -500,7 +486,7 @@ def quota( def types( self, *, - account_id: str | None = None, + account_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, @@ -522,8 +508,6 @@ def types( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -571,7 +555,7 @@ def with_streaming_response(self) -> AsyncRequestsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, priority: str | Omit = omit, request_type: str | Omit = omit, @@ -610,8 +594,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -640,7 +622,7 @@ async def update( self, request_id: str, *, - account_id: str | None = None, + account_id: str, content: str | Omit = omit, priority: str | Omit = omit, request_type: str | Omit = omit, @@ -682,8 +664,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -717,7 +697,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int, per_page: int, completed_after: Union[str, datetime] | Omit = omit, @@ -769,8 +749,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -802,7 +780,7 @@ async def delete( self, request_id: str, *, - account_id: str | None = None, + account_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, @@ -826,8 +804,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -847,7 +823,7 @@ async def delete( async def constants( self, *, - account_id: str | None = None, + account_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, @@ -870,8 +846,6 @@ async def constants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -890,7 +864,7 @@ async def get( self, request_id: str, *, - account_id: str | None = None, + account_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, @@ -914,8 +888,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not request_id: @@ -939,7 +911,7 @@ async def get( async def quota( self, *, - account_id: str | None = None, + account_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, @@ -961,8 +933,6 @@ async def quota( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -980,7 +950,7 @@ async def quota( def types( self, *, - account_id: str | None = None, + account_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, @@ -1002,8 +972,6 @@ def types( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/cloudforce_one/scans/config.py b/src/cloudflare/resources/cloudforce_one/scans/config.py index d6ec1313236..5b5ef4e92e3 100644 --- a/src/cloudflare/resources/cloudforce_one/scans/config.py +++ b/src/cloudflare/resources/cloudforce_one/scans/config.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, ips: SequenceNotStr[str], frequency: float | Omit = omit, ports: SequenceNotStr[str] | Omit = omit, @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -111,7 +109,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -133,8 +131,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -150,7 +146,7 @@ def delete( self, config_id: str, *, - account_id: str | None = None, + account_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, @@ -174,8 +170,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: @@ -200,7 +194,7 @@ def edit( self, config_id: str, *, - account_id: str | None = None, + account_id: str, frequency: float | Omit = omit, ips: SequenceNotStr[str] | Omit = omit, ports: SequenceNotStr[str] | Omit = omit, @@ -236,8 +230,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: @@ -290,7 +282,7 @@ def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, ips: SequenceNotStr[str], frequency: float | Omit = omit, ports: SequenceNotStr[str] | Omit = omit, @@ -324,8 +316,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -351,7 +341,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -373,8 +363,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -390,7 +378,7 @@ async def delete( self, config_id: str, *, - account_id: str | None = None, + account_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, @@ -414,8 +402,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: @@ -440,7 +426,7 @@ async def edit( self, config_id: str, *, - account_id: str | None = None, + account_id: str, frequency: float | Omit = omit, ips: SequenceNotStr[str] | Omit = omit, ports: SequenceNotStr[str] | Omit = omit, @@ -476,8 +462,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: diff --git a/src/cloudflare/resources/cloudforce_one/scans/results.py b/src/cloudflare/resources/cloudforce_one/scans/results.py index be4c7683a52..578dbb1b4f8 100644 --- a/src/cloudflare/resources/cloudforce_one/scans/results.py +++ b/src/cloudflare/resources/cloudforce_one/scans/results.py @@ -47,7 +47,7 @@ def get( self, config_id: str, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: @@ -118,7 +116,7 @@ async def get( self, config_id: str, *, - account_id: str | None = None, + account_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, @@ -142,8 +140,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not config_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py index e4743cd08c3..a9399511a7d 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/attackers.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> AttackersResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -110,7 +108,7 @@ def with_streaming_response(self) -> AsyncAttackersResourceWithStreamingResponse async def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py index 823a1906a79..8267838ea05 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/categories.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/categories.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> CategoriesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, kill_chain: float, name: str, mitre_attack: SequenceNotStr[str] | Omit = omit, @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -100,7 +98,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -126,8 +124,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -146,7 +142,7 @@ def delete( self, category_id: str, *, - account_id: str | None = None, + account_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, @@ -170,8 +166,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: @@ -192,7 +186,7 @@ def edit( self, category_id: str, *, - account_id: str | None = None, + account_id: str, kill_chain: float | Omit = omit, mitre_attack: SequenceNotStr[str] | Omit = omit, mitre_capec: SequenceNotStr[str] | Omit = omit, @@ -221,8 +215,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: @@ -253,7 +245,7 @@ def get( self, category_id: str, *, - account_id: str | None = None, + account_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, @@ -277,8 +269,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: @@ -319,7 +309,7 @@ def with_streaming_response(self) -> AsyncCategoriesResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, kill_chain: float, name: str, mitre_attack: SequenceNotStr[str] | Omit = omit, @@ -346,8 +336,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -371,7 +359,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -397,8 +385,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -419,7 +405,7 @@ async def delete( self, category_id: str, *, - account_id: str | None = None, + account_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, @@ -443,8 +429,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: @@ -465,7 +449,7 @@ async def edit( self, category_id: str, *, - account_id: str | None = None, + account_id: str, kill_chain: float | Omit = omit, mitre_attack: SequenceNotStr[str] | Omit = omit, mitre_capec: SequenceNotStr[str] | Omit = omit, @@ -494,8 +478,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: @@ -526,7 +508,7 @@ async def get( self, category_id: str, *, - account_id: str | None = None, + account_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, @@ -550,8 +532,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not category_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py index c214b7a1a12..8ccdc1b5144 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/countries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/countries.py @@ -43,7 +43,7 @@ def with_streaming_response(self) -> CountriesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -65,8 +65,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -101,7 +99,7 @@ def with_streaming_response(self) -> AsyncCountriesResourceWithStreamingResponse async def list( self, *, - account_id: str | None = None, + account_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, @@ -123,8 +121,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py index d84e8b5bdbc..aa061a94e4a 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> DatasetsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -99,7 +97,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -121,8 +119,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -137,7 +133,7 @@ def edit( self, dataset_id: str, *, - account_id: str | None = None, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -168,8 +164,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -197,7 +191,7 @@ def get( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -221,8 +215,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -243,7 +235,7 @@ def raw( self, event_id: str, *, - account_id: str | None = None, + account_id: str, dataset_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. @@ -272,8 +264,6 @@ def raw( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -317,7 +307,7 @@ def with_streaming_response(self) -> AsyncDatasetsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -346,8 +336,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -368,7 +356,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_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, @@ -390,8 +378,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -406,7 +392,7 @@ async def edit( self, dataset_id: str, *, - account_id: str | None = None, + account_id: str, is_public: bool, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -437,8 +423,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -466,7 +450,7 @@ async def get( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -490,8 +474,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -512,7 +494,7 @@ async def raw( self, event_id: str, *, - account_id: str | None = None, + account_id: str, dataset_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. @@ -541,8 +523,6 @@ async def raw( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py b/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py index edcf808bfc5..7a9557629d9 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/event_tags.py @@ -49,7 +49,7 @@ def create( self, event_id: str, *, - account_id: str | None = None, + account_id: str, tags: SequenceNotStr[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. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -101,7 +99,7 @@ def delete( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -172,7 +168,7 @@ async def create( self, event_id: str, *, - account_id: str | None = None, + account_id: str, tags: SequenceNotStr[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. @@ -197,8 +193,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -224,7 +218,7 @@ async def delete( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -248,8 +242,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py b/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py index fe68ce94269..dd45287ec96 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/indicator_types.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> IndicatorTypesResourceWithStreamingResponse def list( self, *, - account_id: str | None = None, + account_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, @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -107,7 +105,7 @@ def with_streaming_response(self) -> AsyncIndicatorTypesResourceWithStreamingRes async def list( self, *, - account_id: str | None = None, + account_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, @@ -131,8 +129,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py index 584c56cc47f..f0e176a14a9 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/raw.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/raw.py @@ -46,7 +46,7 @@ def edit( self, raw_id: str, *, - account_id: str | None = None, + account_id: str, event_id: str, data: object | Omit = omit, source: str | Omit = omit, @@ -76,8 +76,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -109,7 +107,7 @@ def get( self, raw_id: str, *, - account_id: str | None = None, + account_id: str, event_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. @@ -136,8 +134,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -182,7 +178,7 @@ async def edit( self, raw_id: str, *, - account_id: str | None = None, + account_id: str, event_id: str, data: object | Omit = omit, source: str | Omit = omit, @@ -212,8 +208,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -245,7 +239,7 @@ async def get( self, raw_id: str, *, - account_id: str | None = None, + account_id: str, event_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. @@ -272,8 +266,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py index 098c33bc5bc..f82647c89a4 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/relate.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/relate.py @@ -47,7 +47,7 @@ def delete( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -118,7 +116,7 @@ async def delete( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -142,8 +140,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py index 6efb7037628..e658f166eef 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/tags.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/tags.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> TagsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, value: str, active_duration: str | Omit = omit, actor_category: str | Omit = omit, @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -139,7 +137,7 @@ def with_streaming_response(self) -> AsyncTagsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, value: str, active_duration: str | Omit = omit, actor_category: str | Omit = omit, @@ -177,8 +175,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py b/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py index 60f9e7e8be3..0cf0d41e110 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/target_industries.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> TargetIndustriesResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -112,7 +110,7 @@ def with_streaming_response(self) -> AsyncTargetIndustriesResourceWithStreamingR async def list( self, *, - account_id: str | None = None, + account_id: str, dataset_ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py index 2bf7fa22434..a6ce67298e5 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py @@ -178,7 +178,7 @@ def with_streaming_response(self) -> ThreatEventsResourceWithStreamingResponse: def create( self, *, - path_account_id: str | None = None, + path_account_id: str, category: str, date: Union[str, datetime], event: str, @@ -222,8 +222,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if path_account_id is None: - path_account_id = self._client._get_account_id_path_param() if not path_account_id: raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") return self._post( @@ -258,7 +256,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, dataset_id: SequenceNotStr[str] | Omit = omit, force_refresh: bool | Omit = omit, @@ -276,11 +274,11 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventListResponse: """ - When `datasetId` is unspecified, events will be listed from the - `Cloudforce One Threat Events` dataset. To list existing datasets (and their - IDs), use the + Use `datasetId=all` or `datasetId=*` to query all event datasets for the account + (limited to 10). When `datasetId` is unspecified, events are listed from the + default Cloudforce One Threat Events dataset. To list existing datasets, use the [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) - endpoint). Also, must provide query parameters. + endpoint. Args: account_id: Account ID. @@ -290,6 +288,10 @@ def list( result_info.cursor field. Use cursor-based pagination for deep pagination (beyond 100,000 records) or for optimal performance. + dataset_id: Dataset IDs to query events from (array of UUIDs), or special value 'all' or + '\\**' to query all event datasets for the account. If not provided, uses the + default dataset. + page: Page number (1-indexed) for offset-based pagination. Limited to offset of 100,000 records. For deep pagination, use cursor-based pagination instead. @@ -303,8 +305,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -335,7 +335,7 @@ def list( def bulk_create( self, *, - account_id: str | None = None, + account_id: str, data: Iterable[threat_event_bulk_create_params.Data], dataset_id: str, include_created_events: bool | Omit = omit, @@ -367,8 +367,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -391,7 +389,7 @@ def edit( self, event_id: str, *, - account_id: str | None = None, + account_id: str, dataset_id: str, attacker: Optional[str] | Omit = omit, attacker_country: str | Omit = omit, @@ -431,8 +429,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -471,7 +467,7 @@ def get( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -497,8 +493,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -577,7 +571,7 @@ def with_streaming_response(self) -> AsyncThreatEventsResourceWithStreamingRespo async def create( self, *, - path_account_id: str | None = None, + path_account_id: str, category: str, date: Union[str, datetime], event: str, @@ -621,8 +615,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if path_account_id is None: - path_account_id = self._client._get_account_id_path_param() if not path_account_id: raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") return await self._post( @@ -657,7 +649,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, dataset_id: SequenceNotStr[str] | Omit = omit, force_refresh: bool | Omit = omit, @@ -675,11 +667,11 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ThreatEventListResponse: """ - When `datasetId` is unspecified, events will be listed from the - `Cloudforce One Threat Events` dataset. To list existing datasets (and their - IDs), use the + Use `datasetId=all` or `datasetId=*` to query all event datasets for the account + (limited to 10). When `datasetId` is unspecified, events are listed from the + default Cloudforce One Threat Events dataset. To list existing datasets, use the [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) - endpoint). Also, must provide query parameters. + endpoint. Args: account_id: Account ID. @@ -689,6 +681,10 @@ async def list( result_info.cursor field. Use cursor-based pagination for deep pagination (beyond 100,000 records) or for optimal performance. + dataset_id: Dataset IDs to query events from (array of UUIDs), or special value 'all' or + '\\**' to query all event datasets for the account. If not provided, uses the + default dataset. + page: Page number (1-indexed) for offset-based pagination. Limited to offset of 100,000 records. For deep pagination, use cursor-based pagination instead. @@ -702,8 +698,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -734,7 +728,7 @@ async def list( async def bulk_create( self, *, - account_id: str | None = None, + account_id: str, data: Iterable[threat_event_bulk_create_params.Data], dataset_id: str, include_created_events: bool | Omit = omit, @@ -766,8 +760,6 @@ async def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -790,7 +782,7 @@ async def edit( self, event_id: str, *, - account_id: str | None = None, + account_id: str, dataset_id: str, attacker: Optional[str] | Omit = omit, attacker_country: str | Omit = omit, @@ -830,8 +822,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: @@ -870,7 +860,7 @@ async def get( self, event_id: str, *, - account_id: str | None = None, + account_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, @@ -896,8 +886,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not event_id: diff --git a/src/cloudflare/resources/connectivity/directory/services.py b/src/cloudflare/resources/connectivity/directory/services.py index 00570aff11b..028b6aaf2db 100644 --- a/src/cloudflare/resources/connectivity/directory/services.py +++ b/src/cloudflare/resources/connectivity/directory/services.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> ServicesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraHTTPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -91,7 +91,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -125,11 +125,11 @@ def create( """ ... - @required_args(["host", "name", "type"]) + @required_args(["account_id", "host", "name", "type"]) def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraHTTPServiceConfigHost | service_create_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -147,8 +147,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -186,7 +184,7 @@ def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraHTTPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -223,7 +221,7 @@ def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -255,12 +253,12 @@ def update( """ ... - @required_args(["host", "name", "type"]) + @required_args(["account_id", "host", "name", "type"]) def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraHTTPServiceConfigHost | service_update_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -278,8 +276,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: @@ -321,7 +317,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, type: Optional[Literal["tcp", "http"]] | Omit = omit, @@ -350,8 +346,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -378,7 +372,7 @@ def delete( self, service_id: str, *, - account_id: str | None = None, + account_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, @@ -398,8 +392,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: @@ -421,7 +413,7 @@ def get( self, service_id: str, *, - account_id: str | None = None, + account_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, @@ -441,8 +433,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: @@ -493,7 +483,7 @@ def with_streaming_response(self) -> AsyncServicesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraHTTPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -531,7 +521,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -565,11 +555,11 @@ async def create( """ ... - @required_args(["host", "name", "type"]) + @required_args(["account_id", "host", "name", "type"]) async def create( self, *, - account_id: str | None = None, + account_id: str, host: service_create_params.InfraHTTPServiceConfigHost | service_create_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -587,8 +577,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -626,7 +614,7 @@ async def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraHTTPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -663,7 +651,7 @@ async def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -695,12 +683,12 @@ async def update( """ ... - @required_args(["host", "name", "type"]) + @required_args(["account_id", "host", "name", "type"]) async def update( self, service_id: str, *, - account_id: str | None = None, + account_id: str, host: service_update_params.InfraHTTPServiceConfigHost | service_update_params.InfraTCPServiceConfigHost, name: str, type: Literal["tcp", "http"], @@ -718,8 +706,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ServiceUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: @@ -761,7 +747,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, type: Optional[Literal["tcp", "http"]] | Omit = omit, @@ -790,8 +776,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -818,7 +802,7 @@ async def delete( self, service_id: str, *, - account_id: str | None = None, + account_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, @@ -838,8 +822,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: @@ -861,7 +843,7 @@ async def get( self, service_id: str, *, - account_id: str | None = None, + account_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, @@ -881,8 +863,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_id: diff --git a/src/cloudflare/resources/content_scanning/content_scanning.py b/src/cloudflare/resources/content_scanning/content_scanning.py index d2eee62c10d..ca8668a69a8 100644 --- a/src/cloudflare/resources/content_scanning/content_scanning.py +++ b/src/cloudflare/resources/content_scanning/content_scanning.py @@ -74,7 +74,7 @@ def with_streaming_response(self) -> ContentScanningResourceWithStreamingRespons def create( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["enabled", "disabled"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -99,8 +99,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -119,7 +117,7 @@ def create( def update( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["enabled", "disabled"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -144,8 +142,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -164,7 +160,7 @@ def update( def disable( self, *, - zone_id: str | None = None, + 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, @@ -186,8 +182,6 @@ def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -205,7 +199,7 @@ def disable( def enable( self, *, - zone_id: str | None = None, + 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, @@ -227,8 +221,6 @@ def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -246,7 +238,7 @@ def enable( def get( self, *, - zone_id: str | None = None, + 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, @@ -268,8 +260,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -316,7 +306,7 @@ def with_streaming_response(self) -> AsyncContentScanningResourceWithStreamingRe async def create( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["enabled", "disabled"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -341,8 +331,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -363,7 +351,7 @@ async def create( async def update( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["enabled", "disabled"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -388,8 +376,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -410,7 +396,7 @@ async def update( async def disable( self, *, - zone_id: str | None = None, + 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, @@ -432,8 +418,6 @@ async def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -451,7 +435,7 @@ async def disable( async def enable( self, *, - zone_id: str | None = None, + 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, @@ -473,8 +457,6 @@ async def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -492,7 +474,7 @@ async def enable( async def get( self, *, - zone_id: str | None = None, + 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, @@ -514,8 +496,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/content_scanning/payloads.py b/src/cloudflare/resources/content_scanning/payloads.py index b01ed70caa7..60b0c9b745f 100644 --- a/src/cloudflare/resources/content_scanning/payloads.py +++ b/src/cloudflare/resources/content_scanning/payloads.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> PayloadsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[payload_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -90,7 +88,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -112,8 +110,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -129,7 +125,7 @@ def delete( self, expression_id: str, *, - zone_id: str | None = None, + 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, @@ -153,8 +149,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not expression_id: @@ -197,7 +191,7 @@ def with_streaming_response(self) -> AsyncPayloadsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[payload_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -220,8 +214,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -238,7 +230,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -260,8 +252,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -277,7 +267,7 @@ def delete( self, expression_id: str, *, - zone_id: str | None = None, + 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, @@ -301,8 +291,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not expression_id: diff --git a/src/cloudflare/resources/content_scanning/settings.py b/src/cloudflare/resources/content_scanning/settings.py index a0dc287149b..ca09d23608b 100644 --- a/src/cloudflare/resources/content_scanning/settings.py +++ b/src/cloudflare/resources/content_scanning/settings.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -130,8 +128,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index e61e7897e6f..3ea0b10468a 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -69,7 +69,7 @@ def with_streaming_response(self) -> CustomCertificatesResourceWithStreamingResp def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, @@ -135,8 +135,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -167,7 +165,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, match: Literal["any", "all"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -204,8 +202,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -233,7 +229,7 @@ def delete( self, custom_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -257,8 +253,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -287,7 +281,7 @@ def edit( self, custom_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, custom_csr_id: str | Omit = omit, @@ -354,8 +348,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -394,7 +386,7 @@ def get( self, custom_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -420,8 +412,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -472,7 +462,7 @@ def with_streaming_response(self) -> AsyncCustomCertificatesResourceWithStreamin async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, @@ -538,8 +528,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -570,7 +558,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, match: Literal["any", "all"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -607,8 +595,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -636,7 +622,7 @@ async def delete( self, custom_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -660,8 +646,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -690,7 +674,7 @@ async def edit( self, custom_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, custom_csr_id: str | Omit = omit, @@ -757,8 +741,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -797,7 +779,7 @@ async def get( self, custom_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -823,8 +805,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: diff --git a/src/cloudflare/resources/custom_certificates/prioritize.py b/src/cloudflare/resources/custom_certificates/prioritize.py index d6d77932c0b..fdd19b40f61 100644 --- a/src/cloudflare/resources/custom_certificates/prioritize.py +++ b/src/cloudflare/resources/custom_certificates/prioritize.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PrioritizeResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, certificates: Iterable[prioritize_update_params.Certificate], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncPrioritizeResourceWithStreamingRespons def update( self, *, - zone_id: str | None = None, + zone_id: str, certificates: Iterable[prioritize_update_params.Certificate], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -140,8 +138,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py index 33f066ba039..125e3df9faf 100644 --- a/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py +++ b/src/cloudflare/resources/custom_hostnames/certificate_pack/certificates.py @@ -49,7 +49,7 @@ def update( self, certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_hostname_id: str, certificate_pack_id: str, custom_certificate: str, @@ -88,8 +88,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -129,7 +127,7 @@ def delete( self, certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_hostname_id: str, certificate_pack_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -162,8 +160,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -213,7 +209,7 @@ async def update( self, certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_hostname_id: str, certificate_pack_id: str, custom_certificate: str, @@ -252,8 +248,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -293,7 +287,7 @@ async def delete( self, certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_hostname_id: str, certificate_pack_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -326,8 +320,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index 52c33ff0284..ab912b5ab63 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -81,7 +81,7 @@ def with_streaming_response(self) -> CustomHostnamesResourceWithStreamingRespons def create( self, *, - zone_id: str | None = None, + zone_id: str, hostname: str, custom_metadata: Dict[str, str] | Omit = omit, ssl: custom_hostname_create_params.SSL | Omit = omit, @@ -122,8 +122,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -149,7 +147,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"] | Omit = omit, custom_origin_server: str | Omit = omit, @@ -248,8 +246,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -285,7 +281,7 @@ def delete( self, custom_hostname_id: str, *, - zone_id: str | None = None, + 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, @@ -310,8 +306,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -332,7 +326,7 @@ def edit( self, custom_hostname_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_metadata: Dict[str, str] | Omit = omit, custom_origin_server: str | Omit = omit, custom_origin_sni: str | Omit = omit, @@ -381,8 +375,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -416,7 +408,7 @@ def get( self, custom_hostname_id: str, *, - zone_id: str | None = None, + 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, @@ -441,8 +433,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -495,7 +485,7 @@ def with_streaming_response(self) -> AsyncCustomHostnamesResourceWithStreamingRe async def create( self, *, - zone_id: str | None = None, + zone_id: str, hostname: str, custom_metadata: Dict[str, str] | Omit = omit, ssl: custom_hostname_create_params.SSL | Omit = omit, @@ -536,8 +526,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -563,7 +551,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"] | Omit = omit, custom_origin_server: str | Omit = omit, @@ -662,8 +650,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -699,7 +685,7 @@ async def delete( self, custom_hostname_id: str, *, - zone_id: str | None = None, + 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, @@ -724,8 +710,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -746,7 +730,7 @@ async def edit( self, custom_hostname_id: str, *, - zone_id: str | None = None, + zone_id: str, custom_metadata: Dict[str, str] | Omit = omit, custom_origin_server: str | Omit = omit, custom_origin_sni: str | Omit = omit, @@ -795,8 +779,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: @@ -830,7 +812,7 @@ async def get( self, custom_hostname_id: str, *, - zone_id: str | None = None, + 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, @@ -855,8 +837,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_hostname_id: diff --git a/src/cloudflare/resources/custom_hostnames/fallback_origin.py b/src/cloudflare/resources/custom_hostnames/fallback_origin.py index 6fe315240e2..b382b805ac5 100644 --- a/src/cloudflare/resources/custom_hostnames/fallback_origin.py +++ b/src/cloudflare/resources/custom_hostnames/fallback_origin.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> FallbackOriginResourceWithStreamingResponse def update( self, *, - zone_id: str | None = None, + zone_id: str, origin: 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. @@ -76,8 +76,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -96,7 +94,7 @@ def update( def delete( self, *, - zone_id: str | None = None, + 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, @@ -120,8 +118,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -139,7 +135,7 @@ def delete( def get( self, *, - zone_id: str | None = None, + 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, @@ -163,8 +159,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -203,7 +197,7 @@ def with_streaming_response(self) -> AsyncFallbackOriginResourceWithStreamingRes async def update( self, *, - zone_id: str | None = None, + zone_id: str, origin: 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. @@ -230,8 +224,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -252,7 +244,7 @@ async def update( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -276,8 +268,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -295,7 +285,7 @@ async def delete( async def get( self, *, - zone_id: str | None = None, + 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, @@ -319,8 +309,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers.py deleted file mode 100644 index 6545ebd198c..00000000000 --- a/src/cloudflare/resources/custom_nameservers.py +++ /dev/null @@ -1,388 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncSinglePage, AsyncSinglePage -from .._base_client import AsyncPaginator, make_request_options -from ..types.custom_nameservers import custom_nameserver_create_params -from ..types.custom_nameservers.custom_nameserver import CustomNameserver -from ..types.custom_nameservers.custom_nameserver_delete_response import CustomNameserverDeleteResponse - -__all__ = ["CustomNameserversResource", "AsyncCustomNameserversResource"] - - -class CustomNameserversResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> CustomNameserversResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return CustomNameserversResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> CustomNameserversResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return CustomNameserversResourceWithStreamingResponse(self) - - def create( - self, - *, - account_id: str, - ns_name: str, - ns_set: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[CustomNameserver]: - """ - Add Account Custom Nameserver - - Args: - account_id: Account identifier tag. - - ns_name: The FQDN of the name server. - - ns_set: The number of the set that this name server belongs to. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not 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}/custom_ns", - body=maybe_transform( - { - "ns_name": ns_name, - "ns_set": ns_set, - }, - custom_nameserver_create_params.CustomNameserverCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserver]]._unwrapper, - ), - cast_to=cast(Type[Optional[CustomNameserver]], ResultWrapper[CustomNameserver]), - ) - - def delete( - self, - custom_ns_id: str, - *, - account_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, - ) -> SyncSinglePage[CustomNameserverDeleteResponse]: - """ - Delete Account Custom Nameserver - - Args: - account_id: Account identifier tag. - - custom_ns_id: The FQDN of the name server. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 custom_ns_id: - raise ValueError(f"Expected a non-empty value for `custom_ns_id` but received {custom_ns_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/custom_ns/{custom_ns_id}", - page=SyncSinglePage[CustomNameserverDeleteResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=str, - method="delete", - ) - - def get( - self, - *, - account_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, - ) -> SyncSinglePage[CustomNameserver]: - """ - List an account's custom nameservers. - - Args: - account_id: Account identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}") - return self._get_api_list( - f"/accounts/{account_id}/custom_ns", - page=SyncSinglePage[CustomNameserver], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=CustomNameserver, - ) - - -class AsyncCustomNameserversResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncCustomNameserversResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncCustomNameserversResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncCustomNameserversResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncCustomNameserversResourceWithStreamingResponse(self) - - async def create( - self, - *, - account_id: str, - ns_name: str, - ns_set: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[CustomNameserver]: - """ - Add Account Custom Nameserver - - Args: - account_id: Account identifier tag. - - ns_name: The FQDN of the name server. - - ns_set: The number of the set that this name server belongs to. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not 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}/custom_ns", - body=await async_maybe_transform( - { - "ns_name": ns_name, - "ns_set": ns_set, - }, - custom_nameserver_create_params.CustomNameserverCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[CustomNameserver]]._unwrapper, - ), - cast_to=cast(Type[Optional[CustomNameserver]], ResultWrapper[CustomNameserver]), - ) - - def delete( - self, - custom_ns_id: str, - *, - account_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, - ) -> AsyncPaginator[CustomNameserverDeleteResponse, AsyncSinglePage[CustomNameserverDeleteResponse]]: - """ - Delete Account Custom Nameserver - - Args: - account_id: Account identifier tag. - - custom_ns_id: The FQDN of the name server. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 custom_ns_id: - raise ValueError(f"Expected a non-empty value for `custom_ns_id` but received {custom_ns_id!r}") - return self._get_api_list( - f"/accounts/{account_id}/custom_ns/{custom_ns_id}", - page=AsyncSinglePage[CustomNameserverDeleteResponse], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=str, - method="delete", - ) - - def get( - self, - *, - account_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, - ) -> AsyncPaginator[CustomNameserver, AsyncSinglePage[CustomNameserver]]: - """ - List an account's custom nameservers. - - Args: - account_id: Account identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}") - return self._get_api_list( - f"/accounts/{account_id}/custom_ns", - page=AsyncSinglePage[CustomNameserver], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=CustomNameserver, - ) - - -class CustomNameserversResourceWithRawResponse: - def __init__(self, custom_nameservers: CustomNameserversResource) -> None: - self._custom_nameservers = custom_nameservers - - self.create = to_raw_response_wrapper( - custom_nameservers.create, - ) - self.delete = to_raw_response_wrapper( - custom_nameservers.delete, - ) - self.get = to_raw_response_wrapper( - custom_nameservers.get, - ) - - -class AsyncCustomNameserversResourceWithRawResponse: - def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: - self._custom_nameservers = custom_nameservers - - self.create = async_to_raw_response_wrapper( - custom_nameservers.create, - ) - self.delete = async_to_raw_response_wrapper( - custom_nameservers.delete, - ) - self.get = async_to_raw_response_wrapper( - custom_nameservers.get, - ) - - -class CustomNameserversResourceWithStreamingResponse: - def __init__(self, custom_nameservers: CustomNameserversResource) -> None: - self._custom_nameservers = custom_nameservers - - self.create = to_streamed_response_wrapper( - custom_nameservers.create, - ) - self.delete = to_streamed_response_wrapper( - custom_nameservers.delete, - ) - self.get = to_streamed_response_wrapper( - custom_nameservers.get, - ) - - -class AsyncCustomNameserversResourceWithStreamingResponse: - def __init__(self, custom_nameservers: AsyncCustomNameserversResource) -> None: - self._custom_nameservers = custom_nameservers - - self.create = async_to_streamed_response_wrapper( - custom_nameservers.create, - ) - self.delete = async_to_streamed_response_wrapper( - custom_nameservers.delete, - ) - self.get = async_to_streamed_response_wrapper( - custom_nameservers.get, - ) diff --git a/src/cloudflare/resources/custom_nameservers/custom_nameservers.py b/src/cloudflare/resources/custom_nameservers/custom_nameservers.py index 3cdc53f6db7..24530514563 100644 --- a/src/cloudflare/resources/custom_nameservers/custom_nameservers.py +++ b/src/cloudflare/resources/custom_nameservers/custom_nameservers.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> CustomNameserversResourceWithStreamingRespo def create( self, *, - account_id: str | None = None, + account_id: str, ns_name: str, ns_set: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -104,7 +102,7 @@ def delete( self, custom_ns_id: str, *, - account_id: str | None = None, + account_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, @@ -128,8 +126,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_ns_id: @@ -149,7 +145,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -171,8 +167,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -208,7 +202,7 @@ def with_streaming_response(self) -> AsyncCustomNameserversResourceWithStreaming async def create( self, *, - account_id: str | None = None, + account_id: str, ns_name: str, ns_set: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -236,8 +230,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -263,7 +255,7 @@ def delete( self, custom_ns_id: str, *, - account_id: str | None = None, + account_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, @@ -287,8 +279,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_ns_id: @@ -308,7 +298,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -330,8 +320,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/custom_pages/assets.py b/src/cloudflare/resources/custom_pages/assets.py index ff10ccab5ab..c152ae35f54 100644 --- a/src/cloudflare/resources/custom_pages/assets.py +++ b/src/cloudflare/resources/custom_pages/assets.py @@ -54,8 +54,8 @@ def create( description: str, name: str, url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -86,10 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -132,8 +128,8 @@ def update( *, description: str, url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -166,10 +162,6 @@ def update( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -209,8 +201,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -236,10 +228,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -279,8 +267,8 @@ def delete( self, asset_name: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -309,10 +297,6 @@ def delete( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -343,8 +327,8 @@ def get( self, asset_name: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -373,10 +357,6 @@ def get( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -433,8 +413,8 @@ async def create( description: str, name: str, url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -465,10 +445,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -511,8 +487,8 @@ async def update( *, description: str, url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -545,10 +521,6 @@ async def update( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -588,8 +560,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -615,10 +587,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -658,8 +626,8 @@ async def delete( self, asset_name: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -688,10 +656,6 @@ async def delete( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -722,8 +686,8 @@ async def get( self, asset_name: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -752,10 +716,6 @@ async def get( """ if not asset_name: raise ValueError(f"Expected a non-empty value for `asset_name` but received {asset_name!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/custom_pages/custom_pages.py b/src/cloudflare/resources/custom_pages/custom_pages.py index 79f52ab25bf..19401c1c52e 100644 --- a/src/cloudflare/resources/custom_pages/custom_pages.py +++ b/src/cloudflare/resources/custom_pages/custom_pages.py @@ -15,7 +15,7 @@ AssetsResourceWithStreamingResponse, AsyncAssetsResourceWithStreamingResponse, ) -from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -77,8 +77,8 @@ def update( *, state: Literal["default", "customized"], url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -110,10 +110,6 @@ def update( """ if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -153,8 +149,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -178,10 +174,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -222,8 +214,8 @@ def get( "waf_challenge", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -251,10 +243,6 @@ def get( """ if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -326,8 +314,8 @@ async def update( *, state: Literal["default", "customized"], url: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -359,10 +347,6 @@ async def update( """ if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -402,8 +386,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -427,10 +411,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -471,8 +451,8 @@ async def get( "waf_challenge", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -500,10 +480,6 @@ async def get( """ if not identifier: raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/d1/database/database.py b/src/cloudflare/resources/d1/database/database.py index e46402bff46..4b78018d872 100644 --- a/src/cloudflare/resources/d1/database/database.py +++ b/src/cloudflare/resources/d1/database/database.py @@ -75,7 +75,7 @@ def with_streaming_response(self) -> DatabaseResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, jurisdiction: Literal["eu", "fedramp"] | Omit = omit, primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | Omit = omit, @@ -108,8 +108,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -136,7 +134,7 @@ def update( self, database_id: str, *, - account_id: str | None = None, + account_id: str, read_replication: database_update_params.ReadReplication, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -163,8 +161,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -187,7 +183,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -218,8 +214,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -246,7 +240,7 @@ def delete( self, database_id: str, *, - account_id: str | None = None, + account_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, @@ -270,8 +264,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -294,7 +286,7 @@ def edit( self, database_id: str, *, - account_id: str | None = None, + account_id: str, read_replication: database_edit_params.ReadReplication | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -321,8 +313,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -346,7 +336,7 @@ def export( self, database_id: str, *, - account_id: str | None = None, + account_id: str, output_format: Literal["polling"], current_bookmark: str | Omit = omit, dump_options: database_export_params.DumpOptions | Omit = omit, @@ -382,8 +372,6 @@ def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -416,7 +404,7 @@ def get( self, database_id: str, *, - account_id: str | None = None, + account_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, @@ -440,8 +428,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -465,7 +451,7 @@ def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["init"], etag: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -506,7 +492,7 @@ def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["ingest"], etag: str, filename: str, @@ -549,7 +535,7 @@ def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["poll"], current_bookmark: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -583,12 +569,16 @@ def import_( """ ... - @required_args(["action", "etag"], ["action", "etag", "filename"], ["action", "current_bookmark"]) + @required_args( + ["account_id", "action", "etag"], + ["account_id", "action", "etag", "filename"], + ["account_id", "action", "current_bookmark"], + ) def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["init"] | Literal["ingest"] | Literal["poll"], etag: str | Omit = omit, filename: str | Omit = omit, @@ -600,8 +590,6 @@ def import_( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -636,7 +624,7 @@ def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str, params: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -672,7 +660,7 @@ def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, batch: Iterable[database_query_params.MultipleQueriesBatch], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -699,12 +687,12 @@ def query( """ ... - @required_args(["sql"], ["batch"]) + @required_args(["account_id", "sql"], ["account_id", "batch"]) def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str | Omit = omit, params: SequenceNotStr[str] | Omit = omit, batch: Iterable[database_query_params.MultipleQueriesBatch] | Omit = omit, @@ -715,8 +703,6 @@ def query( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[QueryResult]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -746,7 +732,7 @@ def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str, params: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -784,7 +770,7 @@ def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, batch: Iterable[database_raw_params.MultipleQueriesBatch], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -813,12 +799,12 @@ def raw( """ ... - @required_args(["sql"], ["batch"]) + @required_args(["account_id", "sql"], ["account_id", "batch"]) def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str | Omit = omit, params: SequenceNotStr[str] | Omit = omit, batch: Iterable[database_raw_params.MultipleQueriesBatch] | Omit = omit, @@ -829,8 +815,6 @@ def raw( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DatabaseRawResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -883,7 +867,7 @@ def with_streaming_response(self) -> AsyncDatabaseResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, jurisdiction: Literal["eu", "fedramp"] | Omit = omit, primary_location_hint: Literal["wnam", "enam", "weur", "eeur", "apac", "oc"] | Omit = omit, @@ -916,8 +900,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -944,7 +926,7 @@ async def update( self, database_id: str, *, - account_id: str | None = None, + account_id: str, read_replication: database_update_params.ReadReplication, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -971,8 +953,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -997,7 +977,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -1028,8 +1008,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -1056,7 +1034,7 @@ async def delete( self, database_id: str, *, - account_id: str | None = None, + account_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, @@ -1080,8 +1058,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1104,7 +1080,7 @@ async def edit( self, database_id: str, *, - account_id: str | None = None, + account_id: str, read_replication: database_edit_params.ReadReplication | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1131,8 +1107,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1158,7 +1132,7 @@ async def export( self, database_id: str, *, - account_id: str | None = None, + account_id: str, output_format: Literal["polling"], current_bookmark: str | Omit = omit, dump_options: database_export_params.DumpOptions | Omit = omit, @@ -1194,8 +1168,6 @@ async def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1228,7 +1200,7 @@ async def get( self, database_id: str, *, - account_id: str | None = None, + account_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, @@ -1252,8 +1224,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1277,7 +1247,7 @@ async def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["init"], etag: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1318,7 +1288,7 @@ async def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["ingest"], etag: str, filename: str, @@ -1361,7 +1331,7 @@ async def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["poll"], current_bookmark: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1395,12 +1365,16 @@ async def import_( """ ... - @required_args(["action", "etag"], ["action", "etag", "filename"], ["action", "current_bookmark"]) + @required_args( + ["account_id", "action", "etag"], + ["account_id", "action", "etag", "filename"], + ["account_id", "action", "current_bookmark"], + ) async def import_( self, database_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal["init"] | Literal["ingest"] | Literal["poll"], etag: str | Omit = omit, filename: str | Omit = omit, @@ -1412,8 +1386,6 @@ async def import_( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatabaseImportResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1448,7 +1420,7 @@ def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str, params: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1484,7 +1456,7 @@ def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, batch: Iterable[database_query_params.MultipleQueriesBatch], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1511,12 +1483,12 @@ def query( """ ... - @required_args(["sql"], ["batch"]) + @required_args(["account_id", "sql"], ["account_id", "batch"]) def query( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str | Omit = omit, params: SequenceNotStr[str] | Omit = omit, batch: Iterable[database_query_params.MultipleQueriesBatch] | Omit = omit, @@ -1527,8 +1499,6 @@ def query( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[QueryResult, AsyncSinglePage[QueryResult]]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -1558,7 +1528,7 @@ def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str, params: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1596,7 +1566,7 @@ def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, batch: Iterable[database_raw_params.MultipleQueriesBatch], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1625,12 +1595,12 @@ def raw( """ ... - @required_args(["sql"], ["batch"]) + @required_args(["account_id", "sql"], ["account_id", "batch"]) def raw( self, database_id: str, *, - account_id: str | None = None, + account_id: str, sql: str | Omit = omit, params: SequenceNotStr[str] | Omit = omit, batch: Iterable[database_raw_params.MultipleQueriesBatch] | Omit = omit, @@ -1641,8 +1611,6 @@ def raw( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DatabaseRawResponse, AsyncSinglePage[DatabaseRawResponse]]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: diff --git a/src/cloudflare/resources/d1/database/time_travel.py b/src/cloudflare/resources/d1/database/time_travel.py index 666fbab7fbb..a0828b0181c 100644 --- a/src/cloudflare/resources/d1/database/time_travel.py +++ b/src/cloudflare/resources/d1/database/time_travel.py @@ -50,7 +50,7 @@ def get_bookmark( self, database_id: str, *, - account_id: str | None = None, + account_id: str, timestamp: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -80,8 +80,6 @@ def get_bookmark( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -109,7 +107,7 @@ def restore( self, database_id: str, *, - account_id: str | None = None, + account_id: str, bookmark: str | Omit = omit, timestamp: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -141,8 +139,6 @@ def restore( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -195,7 +191,7 @@ async def get_bookmark( self, database_id: str, *, - account_id: str | None = None, + account_id: str, timestamp: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -225,8 +221,6 @@ async def get_bookmark( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: @@ -254,7 +248,7 @@ async def restore( self, database_id: str, *, - account_id: str | None = None, + account_id: str, bookmark: str | Omit = omit, timestamp: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -286,8 +280,6 @@ async def restore( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not database_id: diff --git a/src/cloudflare/resources/dcv_delegation.py b/src/cloudflare/resources/dcv_delegation.py deleted file mode 100644 index f421bf26ac2..00000000000 --- a/src/cloudflare/resources/dcv_delegation.py +++ /dev/null @@ -1,180 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from .._types import Body, Query, Headers, NotGiven, not_given -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.dcv_delegation.dcv_delegation_uuid import DCVDelegationUUID - -__all__ = ["DCVDelegationResource", "AsyncDCVDelegationResource"] - - -class DCVDelegationResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DCVDelegationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return DCVDelegationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DCVDelegationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return DCVDelegationResourceWithStreamingResponse(self) - - def get( - 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, - ) -> Optional[DCVDelegationUUID]: - """ - Retrieve the account and zone specific unique identifier used as part of the - CNAME target for DCV Delegation. - - 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._get( - f"/zones/{zone_id}/dcv_delegation/uuid", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DCVDelegationUUID]]._unwrapper, - ), - cast_to=cast(Type[Optional[DCVDelegationUUID]], ResultWrapper[DCVDelegationUUID]), - ) - - -class AsyncDCVDelegationResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDCVDelegationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncDCVDelegationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDCVDelegationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncDCVDelegationResourceWithStreamingResponse(self) - - async def get( - 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, - ) -> Optional[DCVDelegationUUID]: - """ - Retrieve the account and zone specific unique identifier used as part of the - CNAME target for DCV Delegation. - - 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 await self._get( - f"/zones/{zone_id}/dcv_delegation/uuid", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[DCVDelegationUUID]]._unwrapper, - ), - cast_to=cast(Type[Optional[DCVDelegationUUID]], ResultWrapper[DCVDelegationUUID]), - ) - - -class DCVDelegationResourceWithRawResponse: - def __init__(self, dcv_delegation: DCVDelegationResource) -> None: - self._dcv_delegation = dcv_delegation - - self.get = to_raw_response_wrapper( - dcv_delegation.get, - ) - - -class AsyncDCVDelegationResourceWithRawResponse: - def __init__(self, dcv_delegation: AsyncDCVDelegationResource) -> None: - self._dcv_delegation = dcv_delegation - - self.get = async_to_raw_response_wrapper( - dcv_delegation.get, - ) - - -class DCVDelegationResourceWithStreamingResponse: - def __init__(self, dcv_delegation: DCVDelegationResource) -> None: - self._dcv_delegation = dcv_delegation - - self.get = to_streamed_response_wrapper( - dcv_delegation.get, - ) - - -class AsyncDCVDelegationResourceWithStreamingResponse: - def __init__(self, dcv_delegation: AsyncDCVDelegationResource) -> None: - self._dcv_delegation = dcv_delegation - - self.get = async_to_streamed_response_wrapper( - dcv_delegation.get, - ) diff --git a/src/cloudflare/resources/dcv_delegation/dcv_delegation.py b/src/cloudflare/resources/dcv_delegation/dcv_delegation.py index df1dc2f8e60..59c0d68cb48 100644 --- a/src/cloudflare/resources/dcv_delegation/dcv_delegation.py +++ b/src/cloudflare/resources/dcv_delegation/dcv_delegation.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> DCVDelegationResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -109,7 +107,7 @@ def with_streaming_response(self) -> AsyncDCVDelegationResourceWithStreamingResp async def get( self, *, - zone_id: str | None = None, + 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, @@ -132,8 +130,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py b/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py index 84b91e5da26..b64ac76beed 100644 --- a/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py +++ b/src/cloudflare/resources/diagnostics/endpoint_healthchecks.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> EndpointHealthchecksResourceWithStreamingRe def create( self, *, - account_id: str | None = None, + account_id: str, check_type: Literal["icmp"], endpoint: str, name: str | Omit = omit, @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -113,7 +111,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, check_type: Literal["icmp"], endpoint: str, name: str | Omit = omit, @@ -146,8 +144,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -179,7 +175,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -201,8 +197,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -223,7 +217,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -247,8 +241,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -267,7 +259,7 @@ def get( self, id: str, *, - account_id: str | None = None, + account_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, @@ -291,8 +283,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -335,7 +325,7 @@ def with_streaming_response(self) -> AsyncEndpointHealthchecksResourceWithStream async def create( self, *, - account_id: str | None = None, + account_id: str, check_type: Literal["icmp"], endpoint: str, name: str | Omit = omit, @@ -366,8 +356,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -396,7 +384,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, check_type: Literal["icmp"], endpoint: str, name: str | Omit = omit, @@ -429,8 +417,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -462,7 +448,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_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, @@ -484,8 +470,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -506,7 +490,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -530,8 +514,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -550,7 +532,7 @@ async def get( self, id: str, *, - account_id: str | None = None, + account_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, @@ -574,8 +556,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/diagnostics/traceroutes.py b/src/cloudflare/resources/diagnostics/traceroutes.py index dfe0db671f6..349c7ce6286 100644 --- a/src/cloudflare/resources/diagnostics/traceroutes.py +++ b/src/cloudflare/resources/diagnostics/traceroutes.py @@ -45,7 +45,7 @@ def with_streaming_response(self) -> TraceroutesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, targets: SequenceNotStr[str], colos: SequenceNotStr[str] | Omit = omit, options: traceroute_create_params.Options | Omit = omit, @@ -73,8 +73,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -119,7 +117,7 @@ def with_streaming_response(self) -> AsyncTraceroutesResourceWithStreamingRespon def create( self, *, - account_id: str | None = None, + account_id: str, targets: SequenceNotStr[str], colos: SequenceNotStr[str] | Omit = omit, options: traceroute_create_params.Options | Omit = omit, @@ -147,8 +145,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py index 597d0191891..5884ad19588 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/bytimes.py @@ -50,7 +50,7 @@ def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, dimensions: str | Omit = omit, filters: str | Omit = omit, limit: int | Omit = omit, @@ -104,8 +104,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -164,7 +162,7 @@ async def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, dimensions: str | Omit = omit, filters: str | Omit = omit, limit: int | Omit = omit, @@ -218,8 +216,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: diff --git a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py index f3eb2cdb5e1..73c256ed35a 100644 --- a/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py +++ b/src/cloudflare/resources/dns_firewall/analytics/reports/reports.py @@ -61,7 +61,7 @@ def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, dimensions: str | Omit = omit, filters: str | Omit = omit, limit: int | Omit = omit, @@ -111,8 +111,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -174,7 +172,7 @@ async def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, dimensions: str | Omit = omit, filters: str | Omit = omit, limit: int | Omit = omit, @@ -224,8 +222,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: diff --git a/src/cloudflare/resources/dns_firewall/dns_firewall.py b/src/cloudflare/resources/dns_firewall/dns_firewall.py index bd2e75a3bf7..74332313d29 100644 --- a/src/cloudflare/resources/dns_firewall/dns_firewall.py +++ b/src/cloudflare/resources/dns_firewall/dns_firewall.py @@ -82,7 +82,7 @@ def with_streaming_response(self) -> DNSFirewallResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, upstream_ips: SequenceNotStr[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, @@ -157,8 +157,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -191,7 +189,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -219,8 +217,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -246,7 +242,7 @@ def delete( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -270,8 +266,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -296,7 +290,7 @@ def edit( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, deprecate_any_requests: bool | Omit = omit, ecs_fallback: bool | Omit = omit, @@ -373,8 +367,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -414,7 +406,7 @@ def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -438,8 +430,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -492,7 +482,7 @@ def with_streaming_response(self) -> AsyncDNSFirewallResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, upstream_ips: SequenceNotStr[UpstreamIPs], attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, @@ -567,8 +557,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -601,7 +589,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -629,8 +617,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -656,7 +642,7 @@ async def delete( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -680,8 +666,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -706,7 +690,7 @@ async def edit( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, attack_mitigation: Optional[AttackMitigationParam] | Omit = omit, deprecate_any_requests: bool | Omit = omit, ecs_fallback: bool | Omit = omit, @@ -783,8 +767,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -824,7 +806,7 @@ async def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -848,8 +830,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: diff --git a/src/cloudflare/resources/dns_firewall/reverse_dns.py b/src/cloudflare/resources/dns_firewall/reverse_dns.py index 20a3df39245..da88f6b98a0 100644 --- a/src/cloudflare/resources/dns_firewall/reverse_dns.py +++ b/src/cloudflare/resources/dns_firewall/reverse_dns.py @@ -49,7 +49,7 @@ def edit( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, ptr: Dict[str, str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -103,7 +101,7 @@ def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -174,7 +170,7 @@ async def edit( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_id: str, ptr: Dict[str, str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -201,8 +197,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: @@ -228,7 +222,7 @@ async def get( self, dns_firewall_id: str, *, - account_id: str | None = None, + account_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, @@ -252,8 +246,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dns_firewall_id: diff --git a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py index 03c40d41df5..f2646189c7d 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/namespaces.py +++ b/src/cloudflare/resources/durable_objects/namespaces/namespaces.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> NamespacesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -85,8 +85,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -136,7 +134,7 @@ def with_streaming_response(self) -> AsyncNamespacesResourceWithStreamingRespons def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -164,8 +162,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/durable_objects/namespaces/objects.py b/src/cloudflare/resources/durable_objects/namespaces/objects.py index 9933ee3fb24..e000d99ed07 100644 --- a/src/cloudflare/resources/durable_objects/namespaces/objects.py +++ b/src/cloudflare/resources/durable_objects/namespaces/objects.py @@ -46,7 +46,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, limit: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -131,7 +129,7 @@ def list( self, id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, limit: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -164,8 +162,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/email_routing/addresses.py b/src/cloudflare/resources/email_routing/addresses.py index 206f7e5c22c..124ef7863f3 100644 --- a/src/cloudflare/resources/email_routing/addresses.py +++ b/src/cloudflare/resources/email_routing/addresses.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> AddressesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, email: 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. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -96,7 +94,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -130,8 +128,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -159,7 +155,7 @@ def delete( self, destination_address_identifier: str, *, - account_id: str | None = None, + account_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, @@ -183,8 +179,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not destination_address_identifier: @@ -211,7 +205,7 @@ def get( self, destination_address_identifier: str, *, - account_id: str | None = None, + account_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, @@ -235,8 +229,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not destination_address_identifier: @@ -283,7 +275,7 @@ def with_streaming_response(self) -> AsyncAddressesResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_id: str, email: 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. @@ -310,8 +302,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -330,7 +320,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -364,8 +354,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -393,7 +381,7 @@ async def delete( self, destination_address_identifier: str, *, - account_id: str | None = None, + account_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, @@ -417,8 +405,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not destination_address_identifier: @@ -445,7 +431,7 @@ async def get( self, destination_address_identifier: str, *, - account_id: str | None = None, + account_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, @@ -469,8 +455,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not destination_address_identifier: diff --git a/src/cloudflare/resources/email_routing/dns.py b/src/cloudflare/resources/email_routing/dns.py index 87ade44d281..72e45ac5514 100644 --- a/src/cloudflare/resources/email_routing/dns.py +++ b/src/cloudflare/resources/email_routing/dns.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> DNSResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -96,7 +94,7 @@ def create( def delete( self, *, - zone_id: str | None = None, + 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, @@ -120,8 +118,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -137,7 +133,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -162,8 +158,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -182,7 +176,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + zone_id: str, subdomain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -207,8 +201,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -250,7 +242,7 @@ def with_streaming_response(self) -> AsyncDNSResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -276,8 +268,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -296,7 +286,7 @@ async def create( def delete( self, *, - zone_id: str | None = None, + 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, @@ -320,8 +310,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -337,7 +325,7 @@ def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -362,8 +350,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -382,7 +368,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + zone_id: str, subdomain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -407,8 +393,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( diff --git a/src/cloudflare/resources/email_routing/email_routing.py b/src/cloudflare/resources/email_routing/email_routing.py index 815a491c888..a3f499892d8 100644 --- a/src/cloudflare/resources/email_routing/email_routing.py +++ b/src/cloudflare/resources/email_routing/email_routing.py @@ -85,7 +85,7 @@ def with_streaming_response(self) -> EmailRoutingResourceWithStreamingResponse: def disable( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -110,8 +110,6 @@ def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -131,7 +129,7 @@ def disable( def enable( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -155,8 +153,6 @@ def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -175,7 +171,7 @@ def enable( def get( self, *, - zone_id: str | None = None, + 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, @@ -197,8 +193,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -250,7 +244,7 @@ def with_streaming_response(self) -> AsyncEmailRoutingResourceWithStreamingRespo async def disable( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -275,8 +269,6 @@ async def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -296,7 +288,7 @@ async def disable( async def enable( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -320,8 +312,6 @@ async def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -340,7 +330,7 @@ async def enable( async def get( self, *, - zone_id: str | None = None, + 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, @@ -362,8 +352,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_routing/rules/catch_alls.py b/src/cloudflare/resources/email_routing/rules/catch_alls.py index 960c1a9765c..322c09be756 100644 --- a/src/cloudflare/resources/email_routing/rules/catch_alls.py +++ b/src/cloudflare/resources/email_routing/rules/catch_alls.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> CatchAllsResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[CatchAllActionParam], matchers: Iterable[CatchAllMatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -87,8 +87,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -115,7 +113,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -137,8 +135,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -177,7 +173,7 @@ def with_streaming_response(self) -> AsyncCatchAllsResourceWithStreamingResponse async def update( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[CatchAllActionParam], matchers: Iterable[CatchAllMatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -213,8 +209,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -241,7 +235,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -263,8 +257,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_routing/rules/rules.py b/src/cloudflare/resources/email_routing/rules/rules.py index f06fd3331e4..b38ce74c7a0 100644 --- a/src/cloudflare/resources/email_routing/rules/rules.py +++ b/src/cloudflare/resources/email_routing/rules/rules.py @@ -63,7 +63,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -103,8 +103,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -133,7 +131,7 @@ def update( self, rule_identifier: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -174,8 +172,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: @@ -209,7 +205,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, enabled: Literal[True, False] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -240,8 +236,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -268,7 +262,7 @@ def delete( self, rule_identifier: str, *, - zone_id: str | None = None, + 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, @@ -292,8 +286,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: @@ -318,7 +310,7 @@ def get( self, rule_identifier: str, *, - zone_id: str | None = None, + 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, @@ -342,8 +334,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: @@ -392,7 +382,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -432,8 +422,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -462,7 +450,7 @@ async def update( self, rule_identifier: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[ActionParam], matchers: Iterable[MatcherParam], enabled: Literal[True, False] | Omit = omit, @@ -503,8 +491,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: @@ -538,7 +524,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, enabled: Literal[True, False] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -569,8 +555,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -597,7 +581,7 @@ async def delete( self, rule_identifier: str, *, - zone_id: str | None = None, + 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, @@ -621,8 +605,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: @@ -647,7 +629,7 @@ async def get( self, rule_identifier: str, *, - zone_id: str | None = None, + 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, @@ -671,8 +653,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_identifier: diff --git a/src/cloudflare/resources/email_security/investigate/detections.py b/src/cloudflare/resources/email_security/investigate/detections.py index b8db8f510b2..3bf800a5931 100644 --- a/src/cloudflare/resources/email_security/investigate/detections.py +++ b/src/cloudflare/resources/email_security/investigate/detections.py @@ -47,7 +47,7 @@ def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -119,7 +117,7 @@ async def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -144,8 +142,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py index f161711f98d..c6167137eed 100644 --- a/src/cloudflare/resources/email_security/investigate/investigate.py +++ b/src/cloudflare/resources/email_security/investigate/investigate.py @@ -135,7 +135,7 @@ def with_streaming_response(self) -> InvestigateResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, action_log: bool | Omit = omit, alert_id: str | Omit = omit, cursor: str | Omit = omit, @@ -188,7 +188,7 @@ def list( page: Deprecated: Use cursor pagination instead. - per_page: The number of results per page. + per_page: The number of results per page. Maximum value is 1000. query: The space-delimited term used in the query. The search is case-insensitive. @@ -235,8 +235,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -279,7 +277,7 @@ def get( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -308,8 +306,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -383,7 +379,7 @@ def with_streaming_response(self) -> AsyncInvestigateResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, action_log: bool | Omit = omit, alert_id: str | Omit = omit, cursor: str | Omit = omit, @@ -436,7 +432,7 @@ def list( page: Deprecated: Use cursor pagination instead. - per_page: The number of results per page. + per_page: The number of results per page. Maximum value is 1000. query: The space-delimited term used in the query. The search is case-insensitive. @@ -483,8 +479,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -527,7 +521,7 @@ async def get( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -556,8 +550,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index 48b7b61f3f3..ae07fced89e 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -51,7 +51,7 @@ def create( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -110,7 +108,7 @@ def create( def bulk( self, *, - account_id: str | None = None, + account_id: str, destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], @@ -141,8 +139,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +184,7 @@ async def create( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], @@ -220,8 +216,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -247,7 +241,7 @@ async def create( def bulk( self, *, - account_id: str | None = None, + account_id: str, destination: Literal[ "Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges" ], @@ -278,8 +272,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/email_security/investigate/preview.py b/src/cloudflare/resources/email_security/investigate/preview.py index 6f67f27d05e..17fe835b7f4 100644 --- a/src/cloudflare/resources/email_security/investigate/preview.py +++ b/src/cloudflare/resources/email_security/investigate/preview.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> PreviewResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, postfix_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -78,8 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -100,7 +98,7 @@ def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -171,7 +167,7 @@ def with_streaming_response(self) -> AsyncPreviewResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, postfix_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -201,8 +197,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -225,7 +219,7 @@ async def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -250,8 +244,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/investigate/raw.py b/src/cloudflare/resources/email_security/investigate/raw.py index 1b65794d1dd..39a8a4b6d39 100644 --- a/src/cloudflare/resources/email_security/investigate/raw.py +++ b/src/cloudflare/resources/email_security/investigate/raw.py @@ -47,7 +47,7 @@ def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -118,7 +116,7 @@ async def get( self, postfix_id: str, *, - account_id: str | None = None, + account_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, @@ -142,8 +140,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/investigate/reclassify.py b/src/cloudflare/resources/email_security/investigate/reclassify.py index 43a36a3d1ef..27daa3d7260 100644 --- a/src/cloudflare/resources/email_security/investigate/reclassify.py +++ b/src/cloudflare/resources/email_security/investigate/reclassify.py @@ -48,7 +48,7 @@ def create( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"], submission: bool | Omit = omit, eml_content: str | Omit = omit, @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -138,7 +136,7 @@ async def create( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"], submission: bool | Omit = omit, eml_content: str | Omit = omit, @@ -172,8 +170,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py index 2bb1e0c9404..78d9770cc96 100644 --- a/src/cloudflare/resources/email_security/investigate/release.py +++ b/src/cloudflare/resources/email_security/investigate/release.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> ReleaseResourceWithStreamingResponse: def bulk( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -70,8 +70,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -109,7 +107,7 @@ def with_streaming_response(self) -> AsyncReleaseResourceWithStreamingResponse: def bulk( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -135,8 +133,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/email_security/investigate/trace.py b/src/cloudflare/resources/email_security/investigate/trace.py index 228dce7d129..bcb66883386 100644 --- a/src/cloudflare/resources/email_security/investigate/trace.py +++ b/src/cloudflare/resources/email_security/investigate/trace.py @@ -48,7 +48,7 @@ def get( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -77,8 +77,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: @@ -125,7 +123,7 @@ async def get( self, postfix_id: str, *, - account_id: str | None = None, + account_id: str, submission: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -154,8 +152,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not postfix_id: diff --git a/src/cloudflare/resources/email_security/phishguard/reports.py b/src/cloudflare/resources/email_security/phishguard/reports.py index 5e77df7ac57..b41c7cdaefc 100644 --- a/src/cloudflare/resources/email_security/phishguard/reports.py +++ b/src/cloudflare/resources/email_security/phishguard/reports.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ReportsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, end: Union[str, datetime] | Omit = omit, from_date: Union[str, date] | Omit = omit, start: Union[str, datetime] | Omit = omit, @@ -79,8 +79,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -128,7 +126,7 @@ def with_streaming_response(self) -> AsyncReportsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, end: Union[str, datetime] | Omit = omit, from_date: Union[str, date] | Omit = omit, start: Union[str, datetime] | Omit = omit, @@ -159,8 +157,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/email_security/settings/allow_policies.py b/src/cloudflare/resources/email_security/settings/allow_policies.py index 39aa95c39ab..d9c3950c649 100644 --- a/src/cloudflare/resources/email_security/settings/allow_policies.py +++ b/src/cloudflare/resources/email_security/settings/allow_policies.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> AllowPoliciesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, is_acceptable_sender: bool, is_exempt_recipient: bool, is_regex: bool, @@ -102,8 +102,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -137,7 +135,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, is_acceptable_sender: bool | Omit = omit, is_exempt_recipient: bool | Omit = omit, @@ -185,8 +183,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -224,7 +220,7 @@ def delete( self, policy_id: int, *, - account_id: str | None = None, + account_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, @@ -250,8 +246,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -274,7 +268,7 @@ def edit( self, policy_id: int, *, - account_id: str | None = None, + account_id: str, comments: Optional[str] | Omit = omit, is_acceptable_sender: Optional[bool] | Omit = omit, is_exempt_recipient: Optional[bool] | Omit = omit, @@ -318,8 +312,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -355,7 +347,7 @@ def get( self, policy_id: int, *, - account_id: str | None = None, + account_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, @@ -380,8 +372,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -424,7 +414,7 @@ def with_streaming_response(self) -> AsyncAllowPoliciesResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, is_acceptable_sender: bool, is_exempt_recipient: bool, is_regex: bool, @@ -469,8 +459,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -504,7 +492,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, is_acceptable_sender: bool | Omit = omit, is_exempt_recipient: bool | Omit = omit, @@ -552,8 +540,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -591,7 +577,7 @@ async def delete( self, policy_id: int, *, - account_id: str | None = None, + account_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, @@ -617,8 +603,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -641,7 +625,7 @@ async def edit( self, policy_id: int, *, - account_id: str | None = None, + account_id: str, comments: Optional[str] | Omit = omit, is_acceptable_sender: Optional[bool] | Omit = omit, is_exempt_recipient: Optional[bool] | Omit = omit, @@ -685,8 +669,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -722,7 +704,7 @@ async def get( self, policy_id: int, *, - account_id: str | None = None, + account_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, @@ -747,8 +729,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index 47336dbdcf6..9f22d1a96a5 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> BlockSendersResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, is_regex: bool, pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -112,7 +110,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["pattern", "created_at"] | Omit = omit, page: int | Omit = omit, @@ -153,8 +151,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -185,7 +181,7 @@ def delete( self, pattern_id: int, *, - account_id: str | None = None, + account_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, @@ -210,8 +206,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -234,7 +228,7 @@ def edit( self, pattern_id: int, *, - account_id: str | None = None, + account_id: str, comments: Optional[str] | Omit = omit, is_regex: Optional[bool] | Omit = omit, pattern: Optional[str] | Omit = omit, @@ -262,8 +256,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -295,7 +287,7 @@ def get( self, pattern_id: int, *, - account_id: str | None = None, + account_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, @@ -320,8 +312,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -364,7 +354,7 @@ def with_streaming_response(self) -> AsyncBlockSendersResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, is_regex: bool, pattern: str, pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"], @@ -391,8 +381,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -419,7 +407,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["pattern", "created_at"] | Omit = omit, page: int | Omit = omit, @@ -460,8 +448,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -492,7 +478,7 @@ async def delete( self, pattern_id: int, *, - account_id: str | None = None, + account_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, @@ -517,8 +503,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -541,7 +525,7 @@ async def edit( self, pattern_id: int, *, - account_id: str | None = None, + account_id: str, comments: Optional[str] | Omit = omit, is_regex: Optional[bool] | Omit = omit, pattern: Optional[str] | Omit = omit, @@ -569,8 +553,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -602,7 +584,7 @@ async def get( self, pattern_id: int, *, - account_id: str | None = None, + account_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, @@ -627,8 +609,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index bf3671f0b5f..46628f5da7a 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> DomainsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit, allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, @@ -104,8 +104,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -138,7 +136,7 @@ def delete( self, domain_id: int, *, - account_id: str | None = None, + account_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, @@ -162,8 +160,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -185,7 +181,7 @@ def delete( def bulk_delete( self, *, - account_id: str | None = None, + account_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, @@ -208,8 +204,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -226,7 +220,7 @@ def edit( self, domain_id: int, *, - account_id: str | None = None, + account_id: str, ip_restrictions: SequenceNotStr[str], allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit, domain: str | Omit = omit, @@ -275,8 +269,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -315,7 +307,7 @@ def get( self, domain_id: int, *, - account_id: str | None = None, + account_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, @@ -339,8 +331,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -383,7 +373,7 @@ def with_streaming_response(self) -> AsyncDomainsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit, allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, @@ -434,8 +424,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -468,7 +456,7 @@ async def delete( self, domain_id: int, *, - account_id: str | None = None, + account_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, @@ -492,8 +480,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -515,7 +501,7 @@ async def delete( def bulk_delete( self, *, - account_id: str | None = None, + account_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, @@ -538,8 +524,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -556,7 +540,7 @@ async def edit( self, domain_id: int, *, - account_id: str | None = None, + account_id: str, ip_restrictions: SequenceNotStr[str], allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit, domain: str | Omit = omit, @@ -605,8 +589,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -645,7 +627,7 @@ async def get( self, domain_id: int, *, - account_id: str | None = None, + account_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, @@ -669,8 +651,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index 4e550771f42..cc5a887645a 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> ImpersonationRegistryResourceWithStreamingR def create( self, *, - account_id: str | None = None, + account_id: str, email: str, is_email_regex: bool, name: str, @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -111,7 +109,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "email", "created_at"] | Omit = omit, page: int | Omit = omit, @@ -152,8 +150,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -185,7 +181,7 @@ def delete( self, display_name_id: int, *, - account_id: str | None = None, + account_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, @@ -207,8 +203,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -231,7 +225,7 @@ def edit( self, display_name_id: int, *, - account_id: str | None = None, + account_id: str, email: Optional[str] | Omit = omit, is_email_regex: Optional[bool] | Omit = omit, name: Optional[str] | Omit = omit, @@ -256,8 +250,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -288,7 +280,7 @@ def get( self, display_name_id: int, *, - account_id: str | None = None, + account_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, @@ -310,8 +302,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -354,7 +344,7 @@ def with_streaming_response(self) -> AsyncImpersonationRegistryResourceWithStrea async def create( self, *, - account_id: str | None = None, + account_id: str, email: str, is_email_regex: bool, name: str, @@ -379,8 +369,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -408,7 +396,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "email", "created_at"] | Omit = omit, page: int | Omit = omit, @@ -451,8 +439,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -484,7 +470,7 @@ async def delete( self, display_name_id: int, *, - account_id: str | None = None, + account_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, @@ -506,8 +492,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -530,7 +514,7 @@ async def edit( self, display_name_id: int, *, - account_id: str | None = None, + account_id: str, email: Optional[str] | Omit = omit, is_email_regex: Optional[bool] | Omit = omit, name: Optional[str] | Omit = omit, @@ -555,8 +539,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -587,7 +569,7 @@ async def get( self, display_name_id: int, *, - account_id: str | None = None, + account_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, @@ -609,8 +591,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_security/settings/trusted_domains.py b/src/cloudflare/resources/email_security/settings/trusted_domains.py index 5e992975201..2bc4c7a45d2 100644 --- a/src/cloudflare/resources/email_security/settings/trusted_domains.py +++ b/src/cloudflare/resources/email_security/settings/trusted_domains.py @@ -58,7 +58,7 @@ def with_streaming_response(self) -> TrustedDomainsResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, is_recent: bool, is_regex: bool, is_similarity: bool, @@ -98,7 +98,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[trusted_domain_create_params.Variant1Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -124,11 +124,11 @@ def create( """ ... - @required_args(["is_recent", "is_regex", "is_similarity", "pattern"], ["body"]) + @required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"]) def create( self, *, - account_id: str | None = None, + account_id: str, is_recent: bool | Omit = omit, is_regex: bool | Omit = omit, is_similarity: bool | Omit = omit, @@ -142,8 +142,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -177,7 +175,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, is_recent: bool | Omit = omit, is_similarity: bool | Omit = omit, @@ -219,8 +217,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -252,7 +248,7 @@ def delete( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_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, @@ -277,8 +273,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -301,7 +295,7 @@ def edit( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_id: str, comments: str | Omit = omit, is_recent: bool | Omit = omit, is_regex: bool | Omit = omit, @@ -336,8 +330,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -370,7 +362,7 @@ def get( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_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, @@ -394,8 +386,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -439,7 +429,7 @@ def with_streaming_response(self) -> AsyncTrustedDomainsResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, is_recent: bool, is_regex: bool, is_similarity: bool, @@ -479,7 +469,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[trusted_domain_create_params.Variant1Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -505,11 +495,11 @@ async def create( """ ... - @required_args(["is_recent", "is_regex", "is_similarity", "pattern"], ["body"]) + @required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"]) async def create( self, *, - account_id: str | None = None, + account_id: str, is_recent: bool | Omit = omit, is_regex: bool | Omit = omit, is_similarity: bool | Omit = omit, @@ -523,8 +513,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -558,7 +546,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, is_recent: bool | Omit = omit, is_similarity: bool | Omit = omit, @@ -600,8 +588,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -633,7 +619,7 @@ async def delete( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_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, @@ -658,8 +644,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -682,7 +666,7 @@ async def edit( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_id: str, comments: str | Omit = omit, is_recent: bool | Omit = omit, is_regex: bool | Omit = omit, @@ -717,8 +701,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -751,7 +733,7 @@ async def get( self, trusted_domain_id: int, *, - account_id: str | None = None, + account_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, @@ -775,8 +757,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py index 11919010317..a35b261041e 100644 --- a/src/cloudflare/resources/email_security/submissions.py +++ b/src/cloudflare/resources/email_security/submissions.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SubmissionsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, customer_status: Literal["escalated", "reviewed", "unreviewed"] | Omit = omit, end: Union[str, datetime] | Omit = omit, original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, @@ -92,8 +92,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -149,7 +147,7 @@ def with_streaming_response(self) -> AsyncSubmissionsResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, customer_status: Literal["escalated", "reviewed", "unreviewed"] | Omit = omit, end: Union[str, datetime] | Omit = omit, original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit, @@ -192,8 +190,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/email_sending/email_sending.py b/src/cloudflare/resources/email_sending/email_sending.py index 7b3ad4b6657..825a217d6f3 100644 --- a/src/cloudflare/resources/email_sending/email_sending.py +++ b/src/cloudflare/resources/email_sending/email_sending.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> EmailSendingResourceWithStreamingResponse: def send( self, *, - account_id: str | None = None, + account_id: str, from_: email_sending_send_params.From, subject: str, to: Union[str, SequenceNotStr[str]], @@ -112,8 +112,6 @@ def send( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -146,7 +144,7 @@ def send( def send_raw( self, *, - account_id: str | None = None, + account_id: str, from_: str, mime_message: str, recipients: SequenceNotStr[str], @@ -180,8 +178,6 @@ def send_raw( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -232,7 +228,7 @@ def with_streaming_response(self) -> AsyncEmailSendingResourceWithStreamingRespo async def send( self, *, - account_id: str | None = None, + account_id: str, from_: email_sending_send_params.From, subject: str, to: Union[str, SequenceNotStr[str]], @@ -284,8 +280,6 @@ async def send( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -318,7 +312,7 @@ async def send( async def send_raw( self, *, - account_id: str | None = None, + account_id: str, from_: str, mime_message: str, recipients: SequenceNotStr[str], @@ -352,8 +346,6 @@ async def send_raw( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/email_sending/subdomains/dns.py b/src/cloudflare/resources/email_sending/subdomains/dns.py index 41e26a5d9ac..cf8442fa6aa 100644 --- a/src/cloudflare/resources/email_sending/subdomains/dns.py +++ b/src/cloudflare/resources/email_sending/subdomains/dns.py @@ -45,7 +45,7 @@ def get( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: @@ -113,7 +111,7 @@ def get( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -137,8 +135,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: diff --git a/src/cloudflare/resources/email_sending/subdomains/subdomains.py b/src/cloudflare/resources/email_sending/subdomains/subdomains.py index 3b28495a235..41f28bc1ea1 100644 --- a/src/cloudflare/resources/email_sending/subdomains/subdomains.py +++ b/src/cloudflare/resources/email_sending/subdomains/subdomains.py @@ -63,7 +63,7 @@ def with_streaming_response(self) -> SubdomainsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, name: 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. @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -110,7 +108,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -132,8 +130,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -149,7 +145,7 @@ def delete( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -175,8 +171,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: @@ -195,7 +189,7 @@ def get( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -219,8 +213,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: @@ -267,7 +259,7 @@ def with_streaming_response(self) -> AsyncSubdomainsResourceWithStreamingRespons async def create( self, *, - zone_id: str | None = None, + zone_id: str, name: 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. @@ -294,8 +286,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -314,7 +304,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -336,8 +326,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -353,7 +341,7 @@ async def delete( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -379,8 +367,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: @@ -399,7 +385,7 @@ async def get( self, subdomain_id: str, *, - zone_id: str | None = None, + 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, @@ -423,8 +409,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not subdomain_id: diff --git a/src/cloudflare/resources/filters.py b/src/cloudflare/resources/filters.py deleted file mode 100644 index 9ecfd9dc3ab..00000000000 --- a/src/cloudflare/resources/filters.py +++ /dev/null @@ -1,976 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import typing_extensions -from typing import Type, Iterable, Optional, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.filters import ( - filter_list_params, - filter_update_params, - filter_bulk_delete_params, - filter_bulk_update_params, -) -from ..types.filters.firewall_filter import FirewallFilter -from ..types.filters.firewall_filter_param import FirewallFilterParam -from ..types.filters.filter_delete_response import FilterDeleteResponse -from ..types.filters.filter_bulk_delete_response import FilterBulkDeleteResponse - -__all__ = ["FiltersResource", "AsyncFiltersResource"] - - -class FiltersResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> FiltersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return FiltersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> FiltersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return FiltersResourceWithStreamingResponse(self) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def create( - self, - *, - zone_id: str, - body: Iterable[FirewallFilterParam], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[FirewallFilter]: - """ - Creates one or more filters. - - Args: - zone_id: Defines an 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._get_api_list( - f"/zones/{zone_id}/filters", - page=SyncSinglePage[FirewallFilter], - body=maybe_transform(body, Iterable[FirewallFilterParam]), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=FirewallFilter, - method="post", - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def update( - self, - filter_id: str, - *, - zone_id: str, - description: str | Omit = omit, - expression: str | Omit = omit, - paused: bool | Omit = omit, - ref: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> FirewallFilter: - """ - Updates an existing filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - description: An informative summary of the filter. - - expression: The filter expression. For more information, refer to - [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - - paused: When true, indicates that the filter is currently paused. - - ref: A short reference tag. Allows you to select related filters. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return self._put( - f"/zones/{zone_id}/filters/{filter_id}", - body=maybe_transform( - { - "description": description, - "expression": expression, - "paused": paused, - "ref": ref, - }, - filter_update_params.FilterUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, - ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def list( - self, - *, - zone_id: str, - id: str | Omit = omit, - description: str | Omit = omit, - expression: str | Omit = omit, - page: float | Omit = omit, - paused: bool | Omit = omit, - per_page: float | Omit = omit, - ref: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FirewallFilter]: - """Fetches filters in a zone. - - You can filter the results using several optional - parameters. - - Args: - zone_id: Defines an identifier. - - id: The unique identifier of the filter. - - description: A case-insensitive string to find in the description. - - expression: A case-insensitive string to find in the expression. - - page: Page number of paginated results. - - paused: When true, indicates that the filter is currently paused. - - per_page: Number of filters per page. - - ref: The filter ref (a short reference tag) to search for. Must be an exact match. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/filters", - page=SyncV4PagePaginationArray[FirewallFilter], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "id": id, - "description": description, - "expression": expression, - "page": page, - "paused": paused, - "per_page": per_page, - "ref": ref, - }, - filter_list_params.FilterListParams, - ), - ), - model=FirewallFilter, - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def delete( - self, - filter_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, - ) -> FilterDeleteResponse: - """ - Deletes an existing filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return self._delete( - f"/zones/{zone_id}/filters/{filter_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FilterDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[FilterDeleteResponse], ResultWrapper[FilterDeleteResponse]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def bulk_delete( - self, - *, - zone_id: str, - id: SequenceNotStr[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[FilterBulkDeleteResponse]: - """ - Deletes one or more existing filters. - - Args: - zone_id: Defines an 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._delete( - f"/zones/{zone_id}/filters", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"id": id}, filter_bulk_delete_params.FilterBulkDeleteParams), - post_parser=ResultWrapper[Optional[FilterBulkDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def bulk_update( - self, - *, - zone_id: str, - body: Iterable[filter_bulk_update_params.Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[FirewallFilter]: - """ - Updates one or more existing filters. - - Args: - zone_id: Defines an 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._get_api_list( - f"/zones/{zone_id}/filters", - page=SyncSinglePage[FirewallFilter], - body=maybe_transform(body, Iterable[filter_bulk_update_params.Body]), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=FirewallFilter, - method="put", - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def get( - self, - filter_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, - ) -> FirewallFilter: - """ - Fetches the details of a filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return self._get( - f"/zones/{zone_id}/filters/{filter_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, - ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), - ) - - -class AsyncFiltersResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncFiltersResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncFiltersResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncFiltersResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncFiltersResourceWithStreamingResponse(self) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def create( - self, - *, - zone_id: str, - body: Iterable[FirewallFilterParam], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FirewallFilter, AsyncSinglePage[FirewallFilter]]: - """ - Creates one or more filters. - - Args: - zone_id: Defines an 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._get_api_list( - f"/zones/{zone_id}/filters", - page=AsyncSinglePage[FirewallFilter], - body=maybe_transform(body, Iterable[FirewallFilterParam]), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=FirewallFilter, - method="post", - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - async def update( - self, - filter_id: str, - *, - zone_id: str, - description: str | Omit = omit, - expression: str | Omit = omit, - paused: bool | Omit = omit, - ref: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> FirewallFilter: - """ - Updates an existing filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - description: An informative summary of the filter. - - expression: The filter expression. For more information, refer to - [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). - - paused: When true, indicates that the filter is currently paused. - - ref: A short reference tag. Allows you to select related filters. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return await self._put( - f"/zones/{zone_id}/filters/{filter_id}", - body=await async_maybe_transform( - { - "description": description, - "expression": expression, - "paused": paused, - "ref": ref, - }, - filter_update_params.FilterUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, - ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def list( - self, - *, - zone_id: str, - id: str | Omit = omit, - description: str | Omit = omit, - expression: str | Omit = omit, - page: float | Omit = omit, - paused: bool | Omit = omit, - per_page: float | Omit = omit, - ref: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FirewallFilter, AsyncV4PagePaginationArray[FirewallFilter]]: - """Fetches filters in a zone. - - You can filter the results using several optional - parameters. - - Args: - zone_id: Defines an identifier. - - id: The unique identifier of the filter. - - description: A case-insensitive string to find in the description. - - expression: A case-insensitive string to find in the expression. - - page: Page number of paginated results. - - paused: When true, indicates that the filter is currently paused. - - per_page: Number of filters per page. - - ref: The filter ref (a short reference tag) to search for. Must be an exact match. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/filters", - page=AsyncV4PagePaginationArray[FirewallFilter], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "id": id, - "description": description, - "expression": expression, - "page": page, - "paused": paused, - "per_page": per_page, - "ref": ref, - }, - filter_list_params.FilterListParams, - ), - ), - model=FirewallFilter, - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - async def delete( - self, - filter_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, - ) -> FilterDeleteResponse: - """ - Deletes an existing filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return await self._delete( - f"/zones/{zone_id}/filters/{filter_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FilterDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[FilterDeleteResponse], ResultWrapper[FilterDeleteResponse]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - async def bulk_delete( - self, - *, - zone_id: str, - id: SequenceNotStr[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[FilterBulkDeleteResponse]: - """ - Deletes one or more existing filters. - - Args: - zone_id: Defines an 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 await self._delete( - f"/zones/{zone_id}/filters", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"id": id}, filter_bulk_delete_params.FilterBulkDeleteParams), - post_parser=ResultWrapper[Optional[FilterBulkDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[FilterBulkDeleteResponse]], ResultWrapper[FilterBulkDeleteResponse]), - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - def bulk_update( - self, - *, - zone_id: str, - body: Iterable[filter_bulk_update_params.Body], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FirewallFilter, AsyncSinglePage[FirewallFilter]]: - """ - Updates one or more existing filters. - - Args: - zone_id: Defines an 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._get_api_list( - f"/zones/{zone_id}/filters", - page=AsyncSinglePage[FirewallFilter], - body=maybe_transform(body, Iterable[filter_bulk_update_params.Body]), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=FirewallFilter, - method="put", - ) - - @typing_extensions.deprecated( - "The Filters API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#firewall-rules-api-and-filters-api for full details." - ) - async def get( - self, - filter_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, - ) -> FirewallFilter: - """ - Fetches the details of a filter. - - Args: - zone_id: Defines an identifier. - - filter_id: The unique identifier of the filter. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 filter_id: - raise ValueError(f"Expected a non-empty value for `filter_id` but received {filter_id!r}") - return await self._get( - f"/zones/{zone_id}/filters/{filter_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[FirewallFilter]._unwrapper, - ), - cast_to=cast(Type[FirewallFilter], ResultWrapper[FirewallFilter]), - ) - - -class FiltersResourceWithRawResponse: - def __init__(self, filters: FiltersResource) -> None: - self._filters = filters - - self.create = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.create, # pyright: ignore[reportDeprecated], - ) - ) - self.update = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.update, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_delete = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.bulk_delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_update = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.bulk_update, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - filters.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncFiltersResourceWithRawResponse: - def __init__(self, filters: AsyncFiltersResource) -> None: - self._filters = filters - - self.create = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.create, # pyright: ignore[reportDeprecated], - ) - ) - self.update = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.update, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_delete = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.bulk_delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_update = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.bulk_update, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - filters.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class FiltersResourceWithStreamingResponse: - def __init__(self, filters: FiltersResource) -> None: - self._filters = filters - - self.create = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.create, # pyright: ignore[reportDeprecated], - ) - ) - self.update = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.update, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_delete = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.bulk_delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_update = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.bulk_update, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - filters.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncFiltersResourceWithStreamingResponse: - def __init__(self, filters: AsyncFiltersResource) -> None: - self._filters = filters - - self.create = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.create, # pyright: ignore[reportDeprecated], - ) - ) - self.update = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.update, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_delete = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.bulk_delete, # pyright: ignore[reportDeprecated], - ) - ) - self.bulk_update = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.bulk_update, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - filters.get, # pyright: ignore[reportDeprecated], - ) - ) diff --git a/src/cloudflare/resources/filters/filters.py b/src/cloudflare/resources/filters/filters.py index 06deebfb11f..a54aa12f6da 100644 --- a/src/cloudflare/resources/filters/filters.py +++ b/src/cloudflare/resources/filters/filters.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> FiltersResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[FirewallFilterParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -105,7 +103,7 @@ def update( self, filter_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, expression: str | Omit = omit, paused: bool | Omit = omit, @@ -142,8 +140,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: @@ -175,7 +171,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, description: str | Omit = omit, expression: str | Omit = omit, @@ -220,8 +216,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -255,7 +249,7 @@ def delete( self, filter_id: str, *, - zone_id: str | None = None, + 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, @@ -279,8 +273,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: @@ -303,7 +295,7 @@ def delete( def bulk_delete( self, *, - zone_id: str | None = None, + zone_id: str, id: SequenceNotStr[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. @@ -326,8 +318,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -349,7 +339,7 @@ def bulk_delete( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[filter_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -372,8 +362,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -394,7 +382,7 @@ def get( self, filter_id: str, *, - zone_id: str | None = None, + 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, @@ -418,8 +406,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: @@ -463,7 +449,7 @@ def with_streaming_response(self) -> AsyncFiltersResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[FirewallFilterParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -486,8 +472,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -508,7 +492,7 @@ async def update( self, filter_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, expression: str | Omit = omit, paused: bool | Omit = omit, @@ -545,8 +529,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: @@ -578,7 +560,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, description: str | Omit = omit, expression: str | Omit = omit, @@ -623,8 +605,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -658,7 +638,7 @@ async def delete( self, filter_id: str, *, - zone_id: str | None = None, + 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, @@ -682,8 +662,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: @@ -706,7 +684,7 @@ async def delete( async def bulk_delete( self, *, - zone_id: str | None = None, + zone_id: str, id: SequenceNotStr[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. @@ -729,8 +707,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -752,7 +728,7 @@ async def bulk_delete( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[filter_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -775,8 +751,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -797,7 +771,7 @@ async def get( self, filter_id: str, *, - zone_id: str | None = None, + 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, @@ -821,8 +795,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not filter_id: diff --git a/src/cloudflare/resources/firewall/access_rules.py b/src/cloudflare/resources/firewall/access_rules.py index 177fe87b6b0..d47753af13e 100644 --- a/src/cloudflare/resources/firewall/access_rules.py +++ b/src/cloudflare/resources/firewall/access_rules.py @@ -55,8 +55,8 @@ def create( *, configuration: access_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, notes: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -92,10 +92,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -135,8 +131,8 @@ def create( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, configuration: access_rule_list_params.Configuration | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, @@ -188,10 +184,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -237,8 +229,8 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -268,10 +260,6 @@ def delete( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -307,8 +295,8 @@ def edit( *, configuration: access_rule_edit_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, notes: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -345,10 +333,6 @@ def edit( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -390,8 +374,8 @@ def get( self, rule_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -419,10 +403,6 @@ def get( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -478,8 +458,8 @@ async def create( *, configuration: access_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, notes: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -515,10 +495,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -558,8 +534,8 @@ async def create( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, configuration: access_rule_list_params.Configuration | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, @@ -611,10 +587,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -660,8 +632,8 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -691,10 +663,6 @@ async def delete( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -730,8 +698,8 @@ async def edit( *, configuration: access_rule_edit_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, notes: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -768,10 +736,6 @@ async def edit( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -813,8 +777,8 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -842,10 +806,6 @@ async def get( """ if not rule_id: raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/firewall/lockdowns.py b/src/cloudflare/resources/firewall/lockdowns.py index 8d1a41c8d2e..d9a6c6cfa2a 100644 --- a/src/cloudflare/resources/firewall/lockdowns.py +++ b/src/cloudflare/resources/firewall/lockdowns.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> LockdownsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, configurations: ConfigurationParam, urls: SequenceNotStr[OverrideURL], description: str | Omit = omit, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -126,7 +124,7 @@ def update( self, lock_downs_id: str, *, - zone_id: str | None = None, + zone_id: str, configurations: ConfigurationParam, urls: SequenceNotStr[OverrideURL], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,8 +158,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: @@ -190,7 +186,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, created_on: Union[str, datetime] | Omit = omit, description: str | Omit = omit, description_search: str | Omit = omit, @@ -250,8 +246,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -286,7 +280,7 @@ def delete( self, lock_downs_id: str, *, - zone_id: str | None = None, + 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, @@ -310,8 +304,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: @@ -334,7 +326,7 @@ def get( self, lock_downs_id: str, *, - zone_id: str | None = None, + 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, @@ -358,8 +350,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: @@ -402,7 +392,7 @@ def with_streaming_response(self) -> AsyncLockdownsResourceWithStreamingResponse async def create( self, *, - zone_id: str | None = None, + zone_id: str, configurations: ConfigurationParam, urls: SequenceNotStr[OverrideURL], description: str | Omit = omit, @@ -446,8 +436,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -476,7 +464,7 @@ async def update( self, lock_downs_id: str, *, - zone_id: str | None = None, + zone_id: str, configurations: ConfigurationParam, urls: SequenceNotStr[OverrideURL], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -510,8 +498,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: @@ -540,7 +526,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, created_on: Union[str, datetime] | Omit = omit, description: str | Omit = omit, description_search: str | Omit = omit, @@ -600,8 +586,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -636,7 +620,7 @@ async def delete( self, lock_downs_id: str, *, - zone_id: str | None = None, + 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, @@ -660,8 +644,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: @@ -684,7 +666,7 @@ async def get( self, lock_downs_id: str, *, - zone_id: str | None = None, + 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, @@ -708,8 +690,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not lock_downs_id: diff --git a/src/cloudflare/resources/firewall/rules.py b/src/cloudflare/resources/firewall/rules.py index 16d00154c10..2833db93411 100644 --- a/src/cloudflare/resources/firewall/rules.py +++ b/src/cloudflare/resources/firewall/rules.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, action: rule_create_params.Action, filter: FirewallFilterParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -114,7 +112,7 @@ def update( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, action: rule_update_params.Action, filter: FirewallFilterParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -143,8 +141,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -174,7 +170,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, action: str | Omit = omit, description: str | Omit = omit, @@ -216,8 +212,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -250,7 +244,7 @@ def delete( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -274,8 +268,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -298,7 +290,7 @@ def delete( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -320,8 +312,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -340,7 +330,7 @@ def bulk_delete( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -363,8 +353,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -384,7 +372,7 @@ def bulk_edit( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -407,8 +395,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -429,7 +415,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -453,8 +439,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -476,7 +460,7 @@ def get( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -500,8 +484,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -545,7 +527,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, action: rule_create_params.Action, filter: FirewallFilterParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -572,8 +554,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -600,7 +580,7 @@ async def update( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, action: rule_update_params.Action, filter: FirewallFilterParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -629,8 +609,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -660,7 +638,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, action: str | Omit = omit, description: str | Omit = omit, @@ -702,8 +680,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -736,7 +712,7 @@ async def delete( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -760,8 +736,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -784,7 +758,7 @@ async def delete( def bulk_delete( self, *, - zone_id: str | None = None, + 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, @@ -806,8 +780,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -826,7 +798,7 @@ def bulk_delete( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -849,8 +821,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -870,7 +840,7 @@ def bulk_edit( def bulk_update( self, *, - zone_id: str | None = None, + zone_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -893,8 +863,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -915,7 +883,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -939,8 +907,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -962,7 +928,7 @@ async def get( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -986,8 +952,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/firewall/ua_rules.py b/src/cloudflare/resources/firewall/ua_rules.py index 50b272c9076..a65422cca22 100644 --- a/src/cloudflare/resources/firewall/ua_rules.py +++ b/src/cloudflare/resources/firewall/ua_rules.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> UARulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, configuration: ua_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], description: str | Omit = omit, @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -115,7 +113,7 @@ def update( self, ua_rule_id: str, *, - zone_id: str | None = None, + zone_id: str, configuration: ua_rule_update_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], description: str | Omit = omit, @@ -152,8 +150,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: @@ -182,7 +178,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, page: float | Omit = omit, paused: bool | Omit = omit, @@ -222,8 +218,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -252,7 +246,7 @@ def delete( self, ua_rule_id: str, *, - zone_id: str | None = None, + 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, @@ -276,8 +270,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: @@ -298,7 +290,7 @@ def get( self, ua_rule_id: str, *, - zone_id: str | None = None, + 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, @@ -322,8 +314,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: @@ -364,7 +354,7 @@ def with_streaming_response(self) -> AsyncUARulesResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, configuration: ua_rule_create_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], description: str | Omit = omit, @@ -397,8 +387,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -426,7 +414,7 @@ async def update( self, ua_rule_id: str, *, - zone_id: str | None = None, + zone_id: str, configuration: ua_rule_update_params.Configuration, mode: Literal["block", "challenge", "whitelist", "js_challenge", "managed_challenge"], description: str | Omit = omit, @@ -463,8 +451,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: @@ -493,7 +479,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, page: float | Omit = omit, paused: bool | Omit = omit, @@ -533,8 +519,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -563,7 +547,7 @@ async def delete( self, ua_rule_id: str, *, - zone_id: str | None = None, + 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, @@ -587,8 +571,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: @@ -609,7 +591,7 @@ async def get( self, ua_rule_id: str, *, - zone_id: str | None = None, + 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, @@ -633,8 +615,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not ua_rule_id: diff --git a/src/cloudflare/resources/firewall/waf/overrides.py b/src/cloudflare/resources/firewall/waf/overrides.py index c4408e27027..f35fd3d1ef8 100644 --- a/src/cloudflare/resources/firewall/waf/overrides.py +++ b/src/cloudflare/resources/firewall/waf/overrides.py @@ -58,7 +58,7 @@ def with_streaming_response(self) -> OverridesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, urls: SequenceNotStr[OverrideURL], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -110,7 +108,7 @@ def update( self, overrides_id: str, *, - zone_id: str | None = None, + zone_id: str, id: str, rewrite_action: RewriteActionParam, rules: WAFRuleParam, @@ -156,8 +154,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: @@ -189,7 +185,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -220,8 +216,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -248,7 +242,7 @@ def delete( self, overrides_id: str, *, - zone_id: str | None = None, + 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, @@ -275,8 +269,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: @@ -300,7 +292,7 @@ def get( self, overrides_id: str, *, - zone_id: str | None = None, + 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, @@ -327,8 +319,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: @@ -372,7 +362,7 @@ def with_streaming_response(self) -> AsyncOverridesResourceWithStreamingResponse async def create( self, *, - zone_id: str | None = None, + zone_id: str, urls: SequenceNotStr[OverrideURL], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -402,8 +392,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -424,7 +412,7 @@ async def update( self, overrides_id: str, *, - zone_id: str | None = None, + zone_id: str, id: str, rewrite_action: RewriteActionParam, rules: WAFRuleParam, @@ -470,8 +458,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: @@ -503,7 +489,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -534,8 +520,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -562,7 +546,7 @@ async def delete( self, overrides_id: str, *, - zone_id: str | None = None, + 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, @@ -589,8 +573,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: @@ -614,7 +596,7 @@ async def get( self, overrides_id: str, *, - zone_id: str | None = None, + 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, @@ -641,8 +623,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not overrides_id: diff --git a/src/cloudflare/resources/firewall/waf/packages/groups.py b/src/cloudflare/resources/firewall/waf/packages/groups.py index 3a424a2426b..c7ec11c5a9e 100644 --- a/src/cloudflare/resources/firewall/waf/packages/groups.py +++ b/src/cloudflare/resources/firewall/waf/packages/groups.py @@ -54,7 +54,7 @@ def list( self, package_id: str, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, mode: Literal["on", "off"] | Omit = omit, @@ -108,8 +108,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -146,7 +144,7 @@ def edit( self, group_id: str, *, - zone_id: str | None = None, + zone_id: str, package_id: str, mode: Literal["on", "off"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -182,8 +180,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -218,7 +214,7 @@ def get( self, group_id: str, *, - zone_id: str | None = None, + zone_id: str, package_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. @@ -248,8 +244,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -304,7 +298,7 @@ def list( self, package_id: str, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, mode: Literal["on", "off"] | Omit = omit, @@ -358,8 +352,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -396,7 +388,7 @@ async def edit( self, group_id: str, *, - zone_id: str | None = None, + zone_id: str, package_id: str, mode: Literal["on", "off"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -432,8 +424,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -468,7 +458,7 @@ async def get( self, group_id: str, *, - zone_id: str | None = None, + zone_id: str, package_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. @@ -498,8 +488,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: diff --git a/src/cloudflare/resources/firewall/waf/packages/packages.py b/src/cloudflare/resources/firewall/waf/packages/packages.py index 61dd9ab6991..356ae410e67 100644 --- a/src/cloudflare/resources/firewall/waf/packages/packages.py +++ b/src/cloudflare/resources/firewall/waf/packages/packages.py @@ -74,7 +74,7 @@ def with_streaming_response(self) -> PackagesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, name: str | Omit = omit, @@ -118,8 +118,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -150,7 +148,7 @@ def get( self, package_id: str, *, - zone_id: str | None = None, + 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, @@ -177,8 +175,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -231,7 +227,7 @@ def with_streaming_response(self) -> AsyncPackagesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, name: str | Omit = omit, @@ -275,8 +271,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -307,7 +301,7 @@ async def get( self, package_id: str, *, - zone_id: str | None = None, + 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, @@ -334,8 +328,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: diff --git a/src/cloudflare/resources/firewall/waf/packages/rules.py b/src/cloudflare/resources/firewall/waf/packages/rules.py index 5faf0a3458c..0854567e57d 100644 --- a/src/cloudflare/resources/firewall/waf/packages/rules.py +++ b/src/cloudflare/resources/firewall/waf/packages/rules.py @@ -54,7 +54,7 @@ def list( self, package_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, group_id: str | Omit = omit, @@ -110,8 +110,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -149,7 +147,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, package_id: str, mode: Literal["default", "disable", "simulate", "block", "challenge", "on", "off"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -184,8 +182,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -220,7 +216,7 @@ def get( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, package_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. @@ -250,8 +246,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -306,7 +300,7 @@ def list( self, package_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, group_id: str | Omit = omit, @@ -362,8 +356,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -401,7 +393,7 @@ async def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, package_id: str, mode: Literal["default", "disable", "simulate", "block", "challenge", "on", "off"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -436,8 +428,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: @@ -472,7 +462,7 @@ async def get( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, package_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. @@ -502,8 +492,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not package_id: diff --git a/src/cloudflare/resources/fraud.py b/src/cloudflare/resources/fraud.py deleted file mode 100644 index 0d4c657d1c8..00000000000 --- a/src/cloudflare/resources/fraud.py +++ /dev/null @@ -1,319 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..types.fraud import fraud_update_params -from .._base_client import make_request_options -from ..types.fraud.fraud_settings import FraudSettings - -__all__ = ["FraudResource", "AsyncFraudResource"] - - -class FraudResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> FraudResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return FraudResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> FraudResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return FraudResourceWithStreamingResponse(self) - - def update( - self, - *, - zone_id: str, - user_profiles: Literal["enabled", "disabled"] | Omit = omit, - username_expressions: SequenceNotStr[str] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FraudSettings]: - """ - Update Fraud Detection settings for a zone. - - Notes on `username_expressions` behavior: - - - If omitted or set to null, expressions are not modified. - - If provided as an empty array `[]`, all expressions will be cleared. - - Args: - zone_id: Identifier. - - user_profiles: Whether Fraud User Profiles is enabled for the zone. - - username_expressions: List of expressions to detect usernames in write HTTP requests. - - - Maximum of 10 expressions. - - Omit or set to null to leave unchanged on update. - - Provide an empty array `[]` to clear all expressions on update. - - Invalid expressions will result in a 10400 Bad Request with details in the - `messages` array. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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._put( - f"/zones/{zone_id}/fraud_detection/settings", - body=maybe_transform( - { - "user_profiles": user_profiles, - "username_expressions": username_expressions, - }, - fraud_update_params.FraudUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FraudSettings]]._unwrapper, - ), - cast_to=cast(Type[Optional[FraudSettings]], ResultWrapper[FraudSettings]), - ) - - def get( - 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, - ) -> Optional[FraudSettings]: - """ - Retrieve Fraud Detection settings for a zone. - - 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._get( - f"/zones/{zone_id}/fraud_detection/settings", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FraudSettings]]._unwrapper, - ), - cast_to=cast(Type[Optional[FraudSettings]], ResultWrapper[FraudSettings]), - ) - - -class AsyncFraudResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncFraudResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncFraudResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncFraudResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncFraudResourceWithStreamingResponse(self) - - async def update( - self, - *, - zone_id: str, - user_profiles: Literal["enabled", "disabled"] | Omit = omit, - username_expressions: SequenceNotStr[str] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[FraudSettings]: - """ - Update Fraud Detection settings for a zone. - - Notes on `username_expressions` behavior: - - - If omitted or set to null, expressions are not modified. - - If provided as an empty array `[]`, all expressions will be cleared. - - Args: - zone_id: Identifier. - - user_profiles: Whether Fraud User Profiles is enabled for the zone. - - username_expressions: List of expressions to detect usernames in write HTTP requests. - - - Maximum of 10 expressions. - - Omit or set to null to leave unchanged on update. - - Provide an empty array `[]` to clear all expressions on update. - - Invalid expressions will result in a 10400 Bad Request with details in the - `messages` array. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._put( - f"/zones/{zone_id}/fraud_detection/settings", - body=await async_maybe_transform( - { - "user_profiles": user_profiles, - "username_expressions": username_expressions, - }, - fraud_update_params.FraudUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FraudSettings]]._unwrapper, - ), - cast_to=cast(Type[Optional[FraudSettings]], ResultWrapper[FraudSettings]), - ) - - async def get( - 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, - ) -> Optional[FraudSettings]: - """ - Retrieve Fraud Detection settings for a zone. - - 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 await self._get( - f"/zones/{zone_id}/fraud_detection/settings", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[FraudSettings]]._unwrapper, - ), - cast_to=cast(Type[Optional[FraudSettings]], ResultWrapper[FraudSettings]), - ) - - -class FraudResourceWithRawResponse: - def __init__(self, fraud: FraudResource) -> None: - self._fraud = fraud - - self.update = to_raw_response_wrapper( - fraud.update, - ) - self.get = to_raw_response_wrapper( - fraud.get, - ) - - -class AsyncFraudResourceWithRawResponse: - def __init__(self, fraud: AsyncFraudResource) -> None: - self._fraud = fraud - - self.update = async_to_raw_response_wrapper( - fraud.update, - ) - self.get = async_to_raw_response_wrapper( - fraud.get, - ) - - -class FraudResourceWithStreamingResponse: - def __init__(self, fraud: FraudResource) -> None: - self._fraud = fraud - - self.update = to_streamed_response_wrapper( - fraud.update, - ) - self.get = to_streamed_response_wrapper( - fraud.get, - ) - - -class AsyncFraudResourceWithStreamingResponse: - def __init__(self, fraud: AsyncFraudResource) -> None: - self._fraud = fraud - - self.update = async_to_streamed_response_wrapper( - fraud.update, - ) - self.get = async_to_streamed_response_wrapper( - fraud.get, - ) diff --git a/src/cloudflare/resources/fraud/fraud.py b/src/cloudflare/resources/fraud/fraud.py index dc07da5a299..bdb431f9bc3 100644 --- a/src/cloudflare/resources/fraud/fraud.py +++ b/src/cloudflare/resources/fraud/fraud.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> FraudResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, user_profiles: Literal["enabled", "disabled"] | Omit = omit, username_expressions: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -87,8 +87,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -113,7 +111,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -135,8 +133,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -175,7 +171,7 @@ def with_streaming_response(self) -> AsyncFraudResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, user_profiles: Literal["enabled", "disabled"] | Omit = omit, username_expressions: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -214,8 +210,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -240,7 +234,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -262,8 +256,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/google_tag_gateway/config.py b/src/cloudflare/resources/google_tag_gateway/config.py index e63218b6ab5..83d083849d2 100644 --- a/src/cloudflare/resources/google_tag_gateway/config.py +++ b/src/cloudflare/resources/google_tag_gateway/config.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, endpoint: str, hide_original_ip: bool, @@ -87,8 +87,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -116,7 +114,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -138,8 +136,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -178,7 +174,7 @@ def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, endpoint: str, hide_original_ip: bool, @@ -218,8 +214,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -247,7 +241,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -269,8 +263,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/healthchecks/healthchecks.py b/src/cloudflare/resources/healthchecks/healthchecks.py index 33fc59a4f7e..9dba275d99f 100644 --- a/src/cloudflare/resources/healthchecks/healthchecks.py +++ b/src/cloudflare/resources/healthchecks/healthchecks.py @@ -69,7 +69,7 @@ def with_streaming_response(self) -> HealthchecksResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -138,8 +138,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -176,7 +174,7 @@ def update( self, healthcheck_id: str, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -247,8 +245,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -288,7 +284,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -316,8 +312,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -343,7 +337,7 @@ def delete( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -367,8 +361,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -391,7 +383,7 @@ def edit( self, healthcheck_id: str, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -462,8 +454,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -504,7 +494,7 @@ def get( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -528,8 +518,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -576,7 +564,7 @@ def with_streaming_response(self) -> AsyncHealthchecksResourceWithStreamingRespo async def create( self, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -645,8 +633,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -683,7 +669,7 @@ async def update( self, healthcheck_id: str, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -754,8 +740,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -795,7 +779,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -823,8 +807,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -850,7 +832,7 @@ async def delete( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -874,8 +856,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -898,7 +878,7 @@ async def edit( self, healthcheck_id: str, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -969,8 +949,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -1011,7 +989,7 @@ async def get( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -1035,8 +1013,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: diff --git a/src/cloudflare/resources/healthchecks/previews.py b/src/cloudflare/resources/healthchecks/previews.py index fd691b0446c..5f3a984b7b7 100644 --- a/src/cloudflare/resources/healthchecks/previews.py +++ b/src/cloudflare/resources/healthchecks/previews.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> PreviewsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -120,8 +120,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -158,7 +156,7 @@ def delete( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -182,8 +180,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -206,7 +202,7 @@ def get( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -230,8 +226,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -274,7 +268,7 @@ def with_streaming_response(self) -> AsyncPreviewsResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, address: str, name: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -343,8 +337,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -381,7 +373,7 @@ async def delete( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -405,8 +397,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: @@ -429,7 +419,7 @@ async def get( self, healthcheck_id: str, *, - zone_id: str | None = None, + 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, @@ -453,8 +443,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not healthcheck_id: diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index 79b55ac7573..7b5953cf587 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -53,7 +53,7 @@ def update( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, setting_id: Literal["ciphers", "min_tls_version", "http2"], value: SettingValueParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -98,8 +98,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -128,7 +126,7 @@ def delete( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, setting_id: Literal["ciphers", "min_tls_version", "http2"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -162,8 +160,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -191,7 +187,7 @@ def get( self, setting_id: Literal["ciphers", "min_tls_version", "http2"], *, - zone_id: str | None = None, + 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, @@ -222,8 +218,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -262,7 +256,7 @@ async def update( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, setting_id: Literal["ciphers", "min_tls_version", "http2"], value: SettingValueParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -307,8 +301,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -337,7 +329,7 @@ async def delete( self, hostname: str, *, - zone_id: str | None = None, + zone_id: str, setting_id: Literal["ciphers", "min_tls_version", "http2"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -371,8 +363,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -400,7 +390,7 @@ def get( self, setting_id: Literal["ciphers", "min_tls_version", "http2"], *, - zone_id: str | None = None, + 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, @@ -431,8 +421,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: diff --git a/src/cloudflare/resources/hyperdrive/configs.py b/src/cloudflare/resources/hyperdrive/configs.py index 84fa3a6c713..3f0238711cc 100644 --- a/src/cloudflare/resources/hyperdrive/configs.py +++ b/src/cloudflare/resources/hyperdrive/configs.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, origin: config_create_params.Origin, caching: config_create_params.Caching | Omit = omit, @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -118,7 +116,7 @@ def update( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_id: str, name: str, origin: config_update_params.Origin, caching: config_update_params.Caching | Omit = omit, @@ -160,8 +158,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -195,7 +191,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -217,8 +213,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -234,7 +228,7 @@ def delete( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_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, @@ -258,8 +252,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -284,7 +276,7 @@ def edit( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_id: str, caching: config_edit_params.Caching | Omit = omit, mtls: config_edit_params.MTLS | Omit = omit, name: str | Omit = omit, @@ -332,8 +324,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -368,7 +358,7 @@ def get( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_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, @@ -392,8 +382,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -438,7 +426,7 @@ def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, origin: config_create_params.Origin, caching: config_create_params.Caching | Omit = omit, @@ -478,8 +466,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -508,7 +494,7 @@ async def update( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_id: str, name: str, origin: config_update_params.Origin, caching: config_update_params.Caching | Omit = omit, @@ -550,8 +536,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -585,7 +569,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -607,8 +591,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -624,7 +606,7 @@ async def delete( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_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, @@ -648,8 +630,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -674,7 +654,7 @@ async def edit( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_id: str, caching: config_edit_params.Caching | Omit = omit, mtls: config_edit_params.MTLS | Omit = omit, name: str | Omit = omit, @@ -722,8 +702,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: @@ -758,7 +736,7 @@ async def get( self, hyperdrive_id: str, *, - account_id: str | None = None, + account_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, @@ -782,8 +760,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hyperdrive_id: diff --git a/src/cloudflare/resources/iam/api.md b/src/cloudflare/resources/iam/api.md index 94951c4357b..65aba065e57 100644 --- a/src/cloudflare/resources/iam/api.md +++ b/src/cloudflare/resources/iam/api.md @@ -67,15 +67,17 @@ from cloudflare.types.iam.user_groups import ( MemberUpdateResponse, MemberListResponse, MemberDeleteResponse, + MemberGetResponse, ) ``` Methods: -- client.iam.user_groups.members.create(user_group_id, \*, account_id, \*\*params) -> Optional[MemberCreateResponse] +- client.iam.user_groups.members.create(user_group_id, \*, account_id, \*\*params) -> SyncSinglePage[MemberCreateResponse] - client.iam.user_groups.members.update(user_group_id, \*, account_id, \*\*params) -> SyncSinglePage[MemberUpdateResponse] - client.iam.user_groups.members.list(user_group_id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[MemberListResponse] - client.iam.user_groups.members.delete(member_id, \*, account_id, user_group_id) -> Optional[MemberDeleteResponse] +- client.iam.user_groups.members.get(member_id, \*, account_id, user_group_id) -> Optional[MemberGetResponse] ## SSO diff --git a/src/cloudflare/resources/iam/permission_groups.py b/src/cloudflare/resources/iam/permission_groups.py index b8beeacc942..bf74bdcba77 100644 --- a/src/cloudflare/resources/iam/permission_groups.py +++ b/src/cloudflare/resources/iam/permission_groups.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> PermissionGroupsResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, label: str | Omit = omit, name: str | Omit = omit, @@ -86,8 +86,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -116,7 +114,7 @@ def get( self, permission_group_id: str, *, - account_id: str | None = None, + account_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, @@ -140,8 +138,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not permission_group_id: @@ -188,7 +184,7 @@ def with_streaming_response(self) -> AsyncPermissionGroupsResourceWithStreamingR def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, label: str | Omit = omit, name: str | Omit = omit, @@ -225,8 +221,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -255,7 +249,7 @@ async def get( self, permission_group_id: str, *, - account_id: str | None = None, + account_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, @@ -279,8 +273,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not permission_group_id: diff --git a/src/cloudflare/resources/iam/resource_groups.py b/src/cloudflare/resources/iam/resource_groups.py index a1b0486abc5..6974e0c8ce1 100644 --- a/src/cloudflare/resources/iam/resource_groups.py +++ b/src/cloudflare/resources/iam/resource_groups.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> ResourceGroupsResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, name: str, scope: resource_group_create_params.Scope, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def update( self, resource_group_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: resource_group_update_params.Scope | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -137,8 +135,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: @@ -169,7 +165,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -197,8 +193,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -224,7 +218,7 @@ def delete( self, resource_group_id: str, *, - account_id: str | None = None, + account_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, @@ -248,8 +242,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: @@ -274,7 +266,7 @@ def get( self, resource_group_id: str, *, - account_id: str | None = None, + account_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, @@ -298,8 +290,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: @@ -344,7 +334,7 @@ def with_streaming_response(self) -> AsyncResourceGroupsResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, scope: resource_group_create_params.Scope, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -372,8 +362,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -399,7 +387,7 @@ async def update( self, resource_group_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, scope: resource_group_update_params.Scope | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -429,8 +417,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: @@ -461,7 +447,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -489,8 +475,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -516,7 +500,7 @@ async def delete( self, resource_group_id: str, *, - account_id: str | None = None, + account_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, @@ -540,8 +524,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: @@ -566,7 +548,7 @@ async def get( self, resource_group_id: str, *, - account_id: str | None = None, + account_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, @@ -590,8 +572,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_group_id: diff --git a/src/cloudflare/resources/iam/sso.py b/src/cloudflare/resources/iam/sso.py index 9f2bba9b7f2..b759052b831 100644 --- a/src/cloudflare/resources/iam/sso.py +++ b/src/cloudflare/resources/iam/sso.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> SSOResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, email_domain: str, begin_verification: bool | Omit = omit, use_fedramp_language: bool | Omit = omit, @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -112,7 +110,7 @@ def update( self, sso_connector_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool | Omit = omit, use_fedramp_language: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -142,8 +140,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -174,7 +170,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -196,8 +192,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -213,7 +207,7 @@ def delete( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -237,8 +231,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -263,7 +255,7 @@ def begin_verification( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -287,8 +279,6 @@ def begin_verification( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -309,7 +299,7 @@ def get( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -333,8 +323,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -379,7 +367,7 @@ def with_streaming_response(self) -> AsyncSSOResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, email_domain: str, begin_verification: bool | Omit = omit, use_fedramp_language: bool | Omit = omit, @@ -410,8 +398,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -438,7 +424,7 @@ async def update( self, sso_connector_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool | Omit = omit, use_fedramp_language: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -468,8 +454,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -500,7 +484,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -522,8 +506,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -539,7 +521,7 @@ async def delete( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -563,8 +545,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -589,7 +569,7 @@ async def begin_verification( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -613,8 +593,6 @@ async def begin_verification( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: @@ -635,7 +613,7 @@ async def get( self, sso_connector_id: str, *, - account_id: str | None = None, + account_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, @@ -659,8 +637,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sso_connector_id: diff --git a/src/cloudflare/resources/iam/user_groups/members.py b/src/cloudflare/resources/iam/user_groups/members.py index 1e68197614f..b0aa0889f5e 100644 --- a/src/cloudflare/resources/iam/user_groups/members.py +++ b/src/cloudflare/resources/iam/user_groups/members.py @@ -3,11 +3,12 @@ from __future__ import annotations from typing import Type, Iterable, Optional, cast +from typing_extensions import Literal import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import path_template, maybe_transform, async_maybe_transform +from ...._utils import path_template, maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -20,6 +21,7 @@ from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.iam.user_groups import member_list_params, member_create_params, member_update_params +from ....types.iam.user_groups.member_get_response import MemberGetResponse from ....types.iam.user_groups.member_list_response import MemberListResponse from ....types.iam.user_groups.member_create_response import MemberCreateResponse from ....types.iam.user_groups.member_delete_response import MemberDeleteResponse @@ -52,15 +54,15 @@ def create( self, user_group_id: str, *, - account_id: str | None = None, - body: Iterable[member_create_params.Body], + account_id: str, + members: Iterable[member_create_params.Member], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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[MemberCreateResponse]: + ) -> SyncSinglePage[MemberCreateResponse]: """ Add members to a User Group. @@ -77,35 +79,31 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") - return self._post( + return self._get_api_list( path_template( "/accounts/{account_id}/iam/user_groups/{user_group_id}/members", account_id=account_id, user_group_id=user_group_id, ), - body=maybe_transform(body, Iterable[member_create_params.Body]), + page=SyncSinglePage[MemberCreateResponse], + body=maybe_transform(members, Iterable[member_create_params.Member]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MemberCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MemberCreateResponse]], ResultWrapper[MemberCreateResponse]), + model=MemberCreateResponse, + method="post", ) def update( self, user_group_id: str, *, - account_id: str | None = None, - body: Iterable[member_update_params.Body], + account_id: str, + members: Iterable[member_update_params.Member], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -121,7 +119,7 @@ def update( user_group_id: User Group identifier tag. - body: Set/Replace members to a user group. + members: Set/Replace members to a user group. extra_headers: Send extra headers @@ -131,8 +129,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -144,7 +140,7 @@ def update( user_group_id=user_group_id, ), page=SyncSinglePage[MemberUpdateResponse], - body=maybe_transform(body, Iterable[member_update_params.Body]), + body=maybe_transform(members, Iterable[member_update_params.Member]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -156,7 +152,9 @@ def list( self, user_group_id: str, *, - account_id: str | None = None, + account_id: str, + direction: Literal["asc", "desc"] | Omit = omit, + fuzzy_email: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -174,6 +172,10 @@ def list( user_group_id: User Group identifier tag. + direction: The sort order of returned user group members by email. + + fuzzy_email: A string used for filtering members by partial email match. + page: Page number of paginated results. per_page: Maximum number of results per page. @@ -186,8 +188,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -206,6 +206,8 @@ def list( timeout=timeout, query=maybe_transform( { + "direction": direction, + "fuzzy_email": fuzzy_email, "page": page, "per_page": per_page, }, @@ -219,7 +221,7 @@ def delete( self, member_id: str, *, - account_id: str | None = None, + account_id: str, user_group_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. @@ -246,8 +248,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -271,6 +271,60 @@ def delete( cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]), ) + def get( + self, + member_id: str, + *, + account_id: str, + user_group_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[MemberGetResponse]: + """ + Get details of a specific member in a user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + member_id: The identifier of an existing account Member. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + if not member_id: + raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}") + return self._get( + path_template( + "/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}", + account_id=account_id, + user_group_id=user_group_id, + member_id=member_id, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberGetResponse]], ResultWrapper[MemberGetResponse]), + ) + class AsyncMembersResource(AsyncAPIResource): @cached_property @@ -292,19 +346,19 @@ def with_streaming_response(self) -> AsyncMembersResourceWithStreamingResponse: """ return AsyncMembersResourceWithStreamingResponse(self) - async def create( + def create( self, user_group_id: str, *, - account_id: str | None = None, - body: Iterable[member_create_params.Body], + account_id: str, + members: Iterable[member_create_params.Member], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this 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[MemberCreateResponse]: + ) -> AsyncPaginator[MemberCreateResponse, AsyncSinglePage[MemberCreateResponse]]: """ Add members to a User Group. @@ -321,35 +375,31 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") - return await self._post( + return self._get_api_list( path_template( "/accounts/{account_id}/iam/user_groups/{user_group_id}/members", account_id=account_id, user_group_id=user_group_id, ), - body=await async_maybe_transform(body, Iterable[member_create_params.Body]), + page=AsyncSinglePage[MemberCreateResponse], + body=maybe_transform(members, Iterable[member_create_params.Member]), options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MemberCreateResponse]]._unwrapper, + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=cast(Type[Optional[MemberCreateResponse]], ResultWrapper[MemberCreateResponse]), + model=MemberCreateResponse, + method="post", ) def update( self, user_group_id: str, *, - account_id: str | None = None, - body: Iterable[member_update_params.Body], + account_id: str, + members: Iterable[member_update_params.Member], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -365,7 +415,7 @@ def update( user_group_id: User Group identifier tag. - body: Set/Replace members to a user group. + members: Set/Replace members to a user group. extra_headers: Send extra headers @@ -375,8 +425,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -388,7 +436,7 @@ def update( user_group_id=user_group_id, ), page=AsyncSinglePage[MemberUpdateResponse], - body=maybe_transform(body, Iterable[member_update_params.Body]), + body=maybe_transform(members, Iterable[member_update_params.Member]), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -400,7 +448,9 @@ def list( self, user_group_id: str, *, - account_id: str | None = None, + account_id: str, + direction: Literal["asc", "desc"] | Omit = omit, + fuzzy_email: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -418,6 +468,10 @@ def list( user_group_id: User Group identifier tag. + direction: The sort order of returned user group members by email. + + fuzzy_email: A string used for filtering members by partial email match. + page: Page number of paginated results. per_page: Maximum number of results per page. @@ -430,8 +484,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -450,6 +502,8 @@ def list( timeout=timeout, query=maybe_transform( { + "direction": direction, + "fuzzy_email": fuzzy_email, "page": page, "per_page": per_page, }, @@ -463,7 +517,7 @@ async def delete( self, member_id: str, *, - account_id: str | None = None, + account_id: str, user_group_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. @@ -490,8 +544,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -515,6 +567,60 @@ async def delete( cast_to=cast(Type[Optional[MemberDeleteResponse]], ResultWrapper[MemberDeleteResponse]), ) + async def get( + self, + member_id: str, + *, + account_id: str, + user_group_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[MemberGetResponse]: + """ + Get details of a specific member in a user group. + + Args: + account_id: Account identifier tag. + + user_group_id: User Group identifier tag. + + member_id: The identifier of an existing account Member. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 user_group_id: + raise ValueError(f"Expected a non-empty value for `user_group_id` but received {user_group_id!r}") + if not member_id: + raise ValueError(f"Expected a non-empty value for `member_id` but received {member_id!r}") + return await self._get( + path_template( + "/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}", + account_id=account_id, + user_group_id=user_group_id, + member_id=member_id, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[MemberGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[MemberGetResponse]], ResultWrapper[MemberGetResponse]), + ) + class MembersResourceWithRawResponse: def __init__(self, members: MembersResource) -> None: @@ -532,6 +638,9 @@ def __init__(self, members: MembersResource) -> None: self.delete = to_raw_response_wrapper( members.delete, ) + self.get = to_raw_response_wrapper( + members.get, + ) class AsyncMembersResourceWithRawResponse: @@ -550,6 +659,9 @@ def __init__(self, members: AsyncMembersResource) -> None: self.delete = async_to_raw_response_wrapper( members.delete, ) + self.get = async_to_raw_response_wrapper( + members.get, + ) class MembersResourceWithStreamingResponse: @@ -568,6 +680,9 @@ def __init__(self, members: MembersResource) -> None: self.delete = to_streamed_response_wrapper( members.delete, ) + self.get = to_streamed_response_wrapper( + members.get, + ) class AsyncMembersResourceWithStreamingResponse: @@ -586,3 +701,6 @@ def __init__(self, members: AsyncMembersResource) -> None: self.delete = async_to_streamed_response_wrapper( members.delete, ) + self.get = async_to_streamed_response_wrapper( + members.get, + ) diff --git a/src/cloudflare/resources/iam/user_groups/user_groups.py b/src/cloudflare/resources/iam/user_groups/user_groups.py index f85b87da287..ad97c7cd1d6 100644 --- a/src/cloudflare/resources/iam/user_groups/user_groups.py +++ b/src/cloudflare/resources/iam/user_groups/user_groups.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Iterable, Optional, cast +from typing_extensions import Literal import httpx @@ -64,9 +65,9 @@ def with_streaming_response(self) -> UserGroupsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, - policies: Iterable[user_group_create_params.Policy], + policies: Iterable[user_group_create_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -92,8 +93,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -119,7 +118,7 @@ def update( self, user_group_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, policies: Iterable[user_group_update_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -149,8 +148,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -181,9 +178,9 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, - direction: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, fuzzy_name: str | Omit = omit, name: str | Omit = omit, page: float | Omit = omit, @@ -203,8 +200,7 @@ def list( id: ID of the user group to be fetched. - direction: The sort order of returned user groups by name. Default sort order is ascending. - To switch to descending, set this parameter to "desc" + direction: The sort order of returned user groups by name (ascending or descending). fuzzy_name: A string used for searching for user groups containing that substring. @@ -222,8 +218,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -253,7 +247,7 @@ def delete( self, user_group_id: str, *, - account_id: str | None = None, + account_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, @@ -277,8 +271,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -303,7 +295,7 @@ def get( self, user_group_id: str, *, - account_id: str | None = None, + account_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, @@ -327,8 +319,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -377,9 +367,9 @@ def with_streaming_response(self) -> AsyncUserGroupsResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, - policies: Iterable[user_group_create_params.Policy], + policies: Iterable[user_group_create_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -405,8 +395,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -432,7 +420,7 @@ async def update( self, user_group_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, policies: Iterable[user_group_update_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -462,8 +450,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -494,9 +480,9 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, - direction: str | Omit = omit, + direction: Literal["asc", "desc"] | Omit = omit, fuzzy_name: str | Omit = omit, name: str | Omit = omit, page: float | Omit = omit, @@ -516,8 +502,7 @@ def list( id: ID of the user group to be fetched. - direction: The sort order of returned user groups by name. Default sort order is ascending. - To switch to descending, set this parameter to "desc" + direction: The sort order of returned user groups by name (ascending or descending). fuzzy_name: A string used for searching for user groups containing that substring. @@ -535,8 +520,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -566,7 +549,7 @@ async def delete( self, user_group_id: str, *, - account_id: str | None = None, + account_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, @@ -590,8 +573,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: @@ -616,7 +597,7 @@ async def get( self, user_group_id: str, *, - account_id: str | None = None, + account_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, @@ -640,8 +621,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_group_id: diff --git a/src/cloudflare/resources/images/v1/blobs.py b/src/cloudflare/resources/images/v1/blobs.py index 2374aceb403..656075109a4 100644 --- a/src/cloudflare/resources/images/v1/blobs.py +++ b/src/cloudflare/resources/images/v1/blobs.py @@ -47,7 +47,7 @@ def get( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -73,8 +73,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -113,7 +111,7 @@ async def get( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -139,8 +137,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: diff --git a/src/cloudflare/resources/images/v1/keys.py b/src/cloudflare/resources/images/v1/keys.py index 91645597482..355de2efa8f 100644 --- a/src/cloudflare/resources/images/v1/keys.py +++ b/src/cloudflare/resources/images/v1/keys.py @@ -49,7 +49,7 @@ def update( self, signing_key_name: str, *, - account_id: str | None = None, + account_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, @@ -72,8 +72,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not signing_key_name: @@ -97,7 +95,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -120,8 +118,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -140,7 +136,7 @@ def delete( self, signing_key_name: str, *, - account_id: str | None = None, + account_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, @@ -164,8 +160,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not signing_key_name: @@ -211,7 +205,7 @@ async def update( self, signing_key_name: str, *, - account_id: str | None = None, + account_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, @@ -234,8 +228,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not signing_key_name: @@ -259,7 +251,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_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, @@ -282,8 +274,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -302,7 +292,7 @@ async def delete( self, signing_key_name: str, *, - account_id: str | None = None, + account_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, @@ -326,8 +316,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not signing_key_name: diff --git a/src/cloudflare/resources/images/v1/stats.py b/src/cloudflare/resources/images/v1/stats.py index 2786e19d981..231223b06ff 100644 --- a/src/cloudflare/resources/images/v1/stats.py +++ b/src/cloudflare/resources/images/v1/stats.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> StatsResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -111,7 +109,7 @@ def with_streaming_response(self) -> AsyncStatsResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -136,8 +134,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/images/v1/v1.py b/src/cloudflare/resources/images/v1/v1.py index f511a70f4cd..bc3af5aba42 100644 --- a/src/cloudflare/resources/images/v1/v1.py +++ b/src/cloudflare/resources/images/v1/v1.py @@ -99,7 +99,7 @@ def with_streaming_response(self) -> V1ResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, creator: str | Omit = omit, file: FileTypes | Omit = omit, @@ -143,8 +143,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") body = deepcopy_minimal( @@ -180,7 +178,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, creator: Optional[str] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -214,8 +212,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -242,7 +238,7 @@ def delete( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -268,8 +264,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -295,7 +289,7 @@ def edit( self, image_id: str, *, - account_id: str | None = None, + account_id: str, creator: str | Omit = omit, metadata: object | Omit = omit, require_signed_urls: bool | Omit = omit, @@ -333,8 +327,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -363,7 +355,7 @@ def get( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -387,8 +379,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -445,7 +435,7 @@ def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, creator: str | Omit = omit, file: FileTypes | Omit = omit, @@ -489,8 +479,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") body = deepcopy_minimal( @@ -526,7 +514,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, creator: Optional[str] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -560,8 +548,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -588,7 +574,7 @@ async def delete( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -614,8 +600,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -641,7 +625,7 @@ async def edit( self, image_id: str, *, - account_id: str | None = None, + account_id: str, creator: str | Omit = omit, metadata: object | Omit = omit, require_signed_urls: bool | Omit = omit, @@ -679,8 +663,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: @@ -709,7 +691,7 @@ async def get( self, image_id: str, *, - account_id: str | None = None, + account_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, @@ -733,8 +715,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not image_id: diff --git a/src/cloudflare/resources/images/v1/variants.py b/src/cloudflare/resources/images/v1/variants.py index fa4c3f5d2f8..6716fd91f71 100644 --- a/src/cloudflare/resources/images/v1/variants.py +++ b/src/cloudflare/resources/images/v1/variants.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> VariantsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, options: variant_create_params.Options, never_require_signed_urls: bool | Omit = omit, @@ -81,8 +81,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -108,7 +106,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -150,7 +146,7 @@ def delete( self, variant_id: str, *, - account_id: str | None = None, + account_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, @@ -172,8 +168,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: @@ -203,7 +197,7 @@ def edit( self, variant_id: str, *, - account_id: str | None = None, + account_id: str, options: variant_edit_params.Options, never_require_signed_urls: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -232,8 +226,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: @@ -263,7 +255,7 @@ def get( self, variant_id: str, *, - account_id: str | None = None, + account_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, @@ -285,8 +277,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: @@ -329,7 +319,7 @@ def with_streaming_response(self) -> AsyncVariantsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, options: variant_create_params.Options, never_require_signed_urls: bool | Omit = omit, @@ -359,8 +349,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -386,7 +374,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_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, @@ -408,8 +396,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -428,7 +414,7 @@ async def delete( self, variant_id: str, *, - account_id: str | None = None, + account_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, @@ -450,8 +436,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: @@ -481,7 +465,7 @@ async def edit( self, variant_id: str, *, - account_id: str | None = None, + account_id: str, options: variant_edit_params.Options, never_require_signed_urls: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -510,8 +494,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: @@ -541,7 +523,7 @@ async def get( self, variant_id: str, *, - account_id: str | None = None, + account_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, @@ -563,8 +545,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not variant_id: diff --git a/src/cloudflare/resources/images/v2/direct_uploads.py b/src/cloudflare/resources/images/v2/direct_uploads.py index e53bf8095d6..90b38fb5d87 100644 --- a/src/cloudflare/resources/images/v2/direct_uploads.py +++ b/src/cloudflare/resources/images/v2/direct_uploads.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> DirectUploadsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, creator: str | Omit = omit, expiry: Union[str, datetime] | Omit = omit, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be @@ -150,7 +148,7 @@ def with_streaming_response(self) -> AsyncDirectUploadsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, creator: str | Omit = omit, expiry: Union[str, datetime] | Omit = omit, @@ -198,8 +196,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be diff --git a/src/cloudflare/resources/images/v2/v2.py b/src/cloudflare/resources/images/v2/v2.py index a45ae783c9b..8eb4d92744c 100644 --- a/src/cloudflare/resources/images/v2/v2.py +++ b/src/cloudflare/resources/images/v2/v2.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> V2ResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, continuation_token: Optional[str] | Omit = omit, creator: Optional[str] | Omit = omit, meta: v2_list_params.Meta | Omit = omit, @@ -142,8 +142,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -196,7 +194,7 @@ def with_streaming_response(self) -> AsyncV2ResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_id: str, continuation_token: Optional[str] | Omit = omit, creator: Optional[str] | Omit = omit, meta: v2_list_params.Meta | Omit = omit, @@ -278,8 +276,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/asn/asn.py b/src/cloudflare/resources/intel/asn/asn.py index 65b9b13227a..d118da8652b 100644 --- a/src/cloudflare/resources/intel/asn/asn.py +++ b/src/cloudflare/resources/intel/asn/asn.py @@ -59,7 +59,7 @@ def get( self, asn: ASN, *, - account_id: str | None = None, + account_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, @@ -82,8 +82,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -127,7 +125,7 @@ async def get( self, asn: ASN, *, - account_id: str | None = None, + account_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, @@ -150,8 +148,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/asn/subnets.py b/src/cloudflare/resources/intel/asn/subnets.py index f80802bffcb..a2ebe3780e9 100644 --- a/src/cloudflare/resources/intel/asn/subnets.py +++ b/src/cloudflare/resources/intel/asn/subnets.py @@ -45,7 +45,7 @@ def get( self, asn: ASN, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -104,7 +102,7 @@ async def get( self, asn: ASN, *, - account_id: str | None = None, + account_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, @@ -126,8 +124,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py index 2006505644a..7f8e2934d7f 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issue_types.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issue_types.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> IssueTypesResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -104,7 +102,7 @@ def with_streaming_response(self) -> AsyncIssueTypesResourceWithStreamingRespons def get( self, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/intel/attack_surface_report/issues.py b/src/cloudflare/resources/intel/attack_surface_report/issues.py index cdf65eb1c62..46e5ea2175a 100644 --- a/src/cloudflare/resources/intel/attack_surface_report/issues.py +++ b/src/cloudflare/resources/intel/attack_surface_report/issues.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> IssuesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -102,8 +102,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -140,7 +138,7 @@ def list( def class_( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -173,8 +171,6 @@ def class_( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -210,7 +206,7 @@ def dismiss( self, issue_id: str, *, - account_id: str | None = None, + account_id: str, dismiss: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -235,8 +231,6 @@ def dismiss( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not issue_id: @@ -258,7 +252,7 @@ def dismiss( def severity( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -291,8 +285,6 @@ def severity( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -327,7 +319,7 @@ def severity( def type( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -360,8 +352,6 @@ def type( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -417,7 +407,7 @@ def with_streaming_response(self) -> AsyncIssuesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -457,8 +447,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -495,7 +483,7 @@ def list( async def class_( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -528,8 +516,6 @@ async def class_( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -565,7 +551,7 @@ async def dismiss( self, issue_id: str, *, - account_id: str | None = None, + account_id: str, dismiss: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -590,8 +576,6 @@ async def dismiss( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not issue_id: @@ -613,7 +597,7 @@ async def dismiss( async def severity( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -646,8 +630,6 @@ async def severity( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -682,7 +664,7 @@ async def severity( async def type( self, *, - account_id: str | None = None, + account_id: str, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -715,8 +697,6 @@ async def type( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/dns.py b/src/cloudflare/resources/intel/dns.py index cb1e01c3dd3..e72b85286f8 100644 --- a/src/cloudflare/resources/intel/dns.py +++ b/src/cloudflare/resources/intel/dns.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> DNSResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, ipv4: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -77,8 +77,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -126,7 +124,7 @@ def with_streaming_response(self) -> AsyncDNSResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, ipv4: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -156,8 +154,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/intel/domain_history.py b/src/cloudflare/resources/intel/domain_history.py index b216b6bc018..c1be20a5256 100644 --- a/src/cloudflare/resources/intel/domain_history.py +++ b/src/cloudflare/resources/intel/domain_history.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> DomainHistoryResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -112,7 +110,7 @@ def with_streaming_response(self) -> AsyncDomainHistoryResourceWithStreamingResp async def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/domains/bulks.py b/src/cloudflare/resources/intel/domains/bulks.py index e0d132c502e..3eb23666ef6 100644 --- a/src/cloudflare/resources/intel/domains/bulks.py +++ b/src/cloudflare/resources/intel/domains/bulks.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> BulksResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, domain: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncBulksResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, domain: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/domains/domains.py b/src/cloudflare/resources/intel/domains/domains.py index 6c8c4ccb3a8..3dd45d2fa47 100644 --- a/src/cloudflare/resources/intel/domains/domains.py +++ b/src/cloudflare/resources/intel/domains/domains.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> DomainsResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, skip_dns: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -85,8 +85,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -136,7 +134,7 @@ def with_streaming_response(self) -> AsyncDomainsResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, skip_dns: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -162,8 +160,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py index 6927db62857..05778c72e99 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py +++ b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py @@ -75,7 +75,7 @@ def with_streaming_response(self) -> IndicatorFeedsResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -103,8 +103,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -130,7 +128,7 @@ def update( self, feed_id: int, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, is_attributable: bool | Omit = omit, is_downloadable: bool | Omit = omit, @@ -169,8 +167,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -200,7 +196,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -222,8 +218,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -239,7 +233,7 @@ def data( self, feed_id: int, *, - account_id: str | None = None, + account_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, @@ -263,8 +257,6 @@ def data( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "text/csv", **(extra_headers or {})} @@ -282,7 +274,7 @@ def get( self, feed_id: int, *, - account_id: str | None = None, + account_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, @@ -306,8 +298,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -356,7 +346,7 @@ def with_streaming_response(self) -> AsyncIndicatorFeedsResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -384,8 +374,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -411,7 +399,7 @@ async def update( self, feed_id: int, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, is_attributable: bool | Omit = omit, is_downloadable: bool | Omit = omit, @@ -450,8 +438,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -481,7 +467,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -503,8 +489,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -520,7 +504,7 @@ async def data( self, feed_id: int, *, - account_id: str | None = None, + account_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, @@ -544,8 +528,6 @@ async def data( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "text/csv", **(extra_headers or {})} @@ -563,7 +545,7 @@ async def get( self, feed_id: int, *, - account_id: str | None = None, + account_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, @@ -587,8 +569,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/indicator_feeds/permissions.py b/src/cloudflare/resources/intel/indicator_feeds/permissions.py index cfade74f6f3..9375d6dc465 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/permissions.py +++ b/src/cloudflare/resources/intel/indicator_feeds/permissions.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> PermissionsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, account_tag: str | Omit = omit, feed_id: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -103,7 +101,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -144,7 +140,7 @@ def list( def delete( self, *, - account_id: str | None = None, + account_id: str, account_tag: str | Omit = omit, feed_id: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -172,8 +168,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -219,7 +213,7 @@ def with_streaming_response(self) -> AsyncPermissionsResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, account_tag: str | Omit = omit, feed_id: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -247,8 +241,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -273,7 +265,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_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, @@ -295,8 +287,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -314,7 +304,7 @@ async def list( async def delete( self, *, - account_id: str | None = None, + account_id: str, account_tag: str | Omit = omit, feed_id: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -342,8 +332,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( diff --git a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py index fba94caedb1..d27570160a3 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py +++ b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py @@ -48,7 +48,7 @@ def update( self, feed_id: int, *, - account_id: str | None = None, + account_id: str, source: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be @@ -125,7 +123,7 @@ async def update( self, feed_id: int, *, - account_id: str | None = None, + account_id: str, source: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -152,8 +150,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") # It should be noted that the actual Content-Type header that will be diff --git a/src/cloudflare/resources/intel/ips.py b/src/cloudflare/resources/intel/ips.py index d3319403f32..9e22f72988a 100644 --- a/src/cloudflare/resources/intel/ips.py +++ b/src/cloudflare/resources/intel/ips.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> IPsResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, ipv4: str | Omit = omit, ipv6: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -73,8 +73,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -120,7 +118,7 @@ def with_streaming_response(self) -> AsyncIPsResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, ipv4: str | Omit = omit, ipv6: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -146,8 +144,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/intel/miscategorizations.py b/src/cloudflare/resources/intel/miscategorizations.py index c9013cbc0ee..c3dcc3f13e6 100644 --- a/src/cloudflare/resources/intel/miscategorizations.py +++ b/src/cloudflare/resources/intel/miscategorizations.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> MiscategorizationsResourceWithStreamingResp def create( self, *, - account_id: str | None = None, + account_id: str, content_adds: Iterable[int] | Omit = omit, content_removes: Iterable[int] | Omit = omit, indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | Omit = omit, @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -138,7 +136,7 @@ def with_streaming_response(self) -> AsyncMiscategorizationsResourceWithStreamin async def create( self, *, - account_id: str | None = None, + account_id: str, content_adds: Iterable[int] | Omit = omit, content_removes: Iterable[int] | Omit = omit, indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | Omit = omit, @@ -181,8 +179,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/intel/sinkholes.py b/src/cloudflare/resources/intel/sinkholes.py index ab62f76b77c..487453569a4 100644 --- a/src/cloudflare/resources/intel/sinkholes.py +++ b/src/cloudflare/resources/intel/sinkholes.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> SinkholesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -66,8 +66,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -103,7 +101,7 @@ def with_streaming_response(self) -> AsyncSinkholesResourceWithStreamingResponse def list( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/intel/whois.py b/src/cloudflare/resources/intel/whois.py index 2260753a973..cc21da74d4f 100644 --- a/src/cloudflare/resources/intel/whois.py +++ b/src/cloudflare/resources/intel/whois.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> WhoisResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -112,7 +110,7 @@ def with_streaming_response(self) -> AsyncWhoisResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_id: str, domain: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/ips.py b/src/cloudflare/resources/ips.py deleted file mode 100644 index 29d43e4eaa5..00000000000 --- a/src/cloudflare/resources/ips.py +++ /dev/null @@ -1,194 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Any, Optional, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..types.ips import ip_list_params -from .._base_client import make_request_options -from ..types.ips.ip_list_response import IPListResponse - -__all__ = ["IPsResource", "AsyncIPsResource"] - - -class IPsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> IPsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return IPsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> IPsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return IPsResourceWithStreamingResponse(self) - - def list( - self, - *, - networks: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[IPListResponse]: - """ - Get IPs used on the Cloudflare/JD Cloud network, see - https://www.cloudflare.com/ips for Cloudflare IPs or - https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD - Cloud IPs. - - Args: - networks: Specified as `jdcloud` to list IPs used by JD Cloud data centers. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return cast( - Optional[IPListResponse], - self._get( - "/ips", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"networks": networks}, ip_list_params.IPListParams), - post_parser=ResultWrapper[Optional[IPListResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPListResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class AsyncIPsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncIPsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncIPsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncIPsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncIPsResourceWithStreamingResponse(self) - - async def list( - self, - *, - networks: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[IPListResponse]: - """ - Get IPs used on the Cloudflare/JD Cloud network, see - https://www.cloudflare.com/ips for Cloudflare IPs or - https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD - Cloud IPs. - - Args: - networks: Specified as `jdcloud` to list IPs used by JD Cloud data centers. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return cast( - Optional[IPListResponse], - await self._get( - "/ips", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"networks": networks}, ip_list_params.IPListParams), - post_parser=ResultWrapper[Optional[IPListResponse]]._unwrapper, - ), - cast_to=cast( - Any, ResultWrapper[IPListResponse] - ), # Union types cannot be passed in as arguments in the type system - ), - ) - - -class IPsResourceWithRawResponse: - def __init__(self, ips: IPsResource) -> None: - self._ips = ips - - self.list = to_raw_response_wrapper( - ips.list, - ) - - -class AsyncIPsResourceWithRawResponse: - def __init__(self, ips: AsyncIPsResource) -> None: - self._ips = ips - - self.list = async_to_raw_response_wrapper( - ips.list, - ) - - -class IPsResourceWithStreamingResponse: - def __init__(self, ips: IPsResource) -> None: - self._ips = ips - - self.list = to_streamed_response_wrapper( - ips.list, - ) - - -class AsyncIPsResourceWithStreamingResponse: - def __init__(self, ips: AsyncIPsResource) -> None: - self._ips = ips - - self.list = async_to_streamed_response_wrapper( - ips.list, - ) diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py deleted file mode 100644 index 8b0180c31d5..00000000000 --- a/src/cloudflare/resources/keyless_certificates.py +++ /dev/null @@ -1,713 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncSinglePage, AsyncSinglePage -from .._base_client import AsyncPaginator, make_request_options -from ..types.custom_hostnames import BundleMethod -from ..types.keyless_certificates import keyless_certificate_edit_params, keyless_certificate_create_params -from ..types.custom_hostnames.bundle_method import BundleMethod -from ..types.keyless_certificates.tunnel_param import TunnelParam -from ..types.keyless_certificates.keyless_certificate import KeylessCertificate -from ..types.keyless_certificates.keyless_certificate_delete_response import KeylessCertificateDeleteResponse - -__all__ = ["KeylessCertificatesResource", "AsyncKeylessCertificatesResource"] - - -class KeylessCertificatesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> KeylessCertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return KeylessCertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> KeylessCertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return KeylessCertificatesResourceWithStreamingResponse(self) - - def create( - self, - *, - zone_id: str, - certificate: str, - host: str, - port: float, - bundle_method: BundleMethod | Omit = omit, - name: str | Omit = omit, - tunnel: TunnelParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[KeylessCertificate]: - """ - Creates a Keyless SSL configuration that allows SSL/TLS termination without - exposing private keys to Cloudflare. Keys remain on your infrastructure. - - Args: - zone_id: Identifier. - - certificate: The zone's SSL certificate or SSL certificate and intermediate(s). - - host: The keyless SSL name. - - port: The keyless SSL port used to communicate between Cloudflare and the client's - Keyless SSL server. - - bundle_method: A ubiquitous bundle has the highest probability of being verified everywhere, - even by clients using outdated or unusual trust stores. An optimal bundle uses - the shortest chain and newest intermediates. And the force bundle verifies the - chain, but does not otherwise modify it. - - name: The keyless SSL name. - - tunnel: Configuration for using Keyless SSL through a Cloudflare Tunnel - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/keyless_certificates", - body=maybe_transform( - { - "certificate": certificate, - "host": host, - "port": port, - "bundle_method": bundle_method, - "name": name, - "tunnel": tunnel, - }, - keyless_certificate_create_params.KeylessCertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - def list( - 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, - ) -> SyncSinglePage[KeylessCertificate]: - """ - List all Keyless SSL configurations for a given zone. - - 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._get_api_list( - f"/zones/{zone_id}/keyless_certificates", - page=SyncSinglePage[KeylessCertificate], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=KeylessCertificate, - ) - - def delete( - self, - keyless_certificate_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[KeylessCertificateDeleteResponse]: - """Removes a Keyless SSL configuration. - - SSL connections will no longer use the - keyless server for cryptographic operations. - - Args: - zone_id: Identifier. - - keyless_certificate_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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return self._delete( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificateDeleteResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[KeylessCertificateDeleteResponse]], ResultWrapper[KeylessCertificateDeleteResponse] - ), - ) - - def edit( - self, - keyless_certificate_id: str, - *, - zone_id: str, - enabled: bool | Omit = omit, - host: str | Omit = omit, - name: str | Omit = omit, - port: float | Omit = omit, - tunnel: TunnelParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[KeylessCertificate]: - """This will update attributes of a Keyless SSL. - - Consists of one or more of the - following: host,name,port. - - Args: - zone_id: Identifier. - - keyless_certificate_id: Identifier. - - enabled: Whether or not the Keyless SSL is on or off. - - host: The keyless SSL name. - - name: The keyless SSL name. - - port: The keyless SSL port used to communicate between Cloudflare and the client's - Keyless SSL server. - - tunnel: Configuration for using Keyless SSL through a Cloudflare Tunnel - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return self._patch( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - body=maybe_transform( - { - "enabled": enabled, - "host": host, - "name": name, - "port": port, - "tunnel": tunnel, - }, - keyless_certificate_edit_params.KeylessCertificateEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - def get( - self, - keyless_certificate_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[KeylessCertificate]: - """ - Get details for one Keyless SSL configuration. - - Args: - zone_id: Identifier. - - keyless_certificate_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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return self._get( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - -class AsyncKeylessCertificatesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncKeylessCertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncKeylessCertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncKeylessCertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncKeylessCertificatesResourceWithStreamingResponse(self) - - async def create( - self, - *, - zone_id: str, - certificate: str, - host: str, - port: float, - bundle_method: BundleMethod | Omit = omit, - name: str | Omit = omit, - tunnel: TunnelParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[KeylessCertificate]: - """ - Creates a Keyless SSL configuration that allows SSL/TLS termination without - exposing private keys to Cloudflare. Keys remain on your infrastructure. - - Args: - zone_id: Identifier. - - certificate: The zone's SSL certificate or SSL certificate and intermediate(s). - - host: The keyless SSL name. - - port: The keyless SSL port used to communicate between Cloudflare and the client's - Keyless SSL server. - - bundle_method: A ubiquitous bundle has the highest probability of being verified everywhere, - even by clients using outdated or unusual trust stores. An optimal bundle uses - the shortest chain and newest intermediates. And the force bundle verifies the - chain, but does not otherwise modify it. - - name: The keyless SSL name. - - tunnel: Configuration for using Keyless SSL through a Cloudflare Tunnel - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._post( - f"/zones/{zone_id}/keyless_certificates", - body=await async_maybe_transform( - { - "certificate": certificate, - "host": host, - "port": port, - "bundle_method": bundle_method, - "name": name, - "tunnel": tunnel, - }, - keyless_certificate_create_params.KeylessCertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - def list( - 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, - ) -> AsyncPaginator[KeylessCertificate, AsyncSinglePage[KeylessCertificate]]: - """ - List all Keyless SSL configurations for a given zone. - - 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._get_api_list( - f"/zones/{zone_id}/keyless_certificates", - page=AsyncSinglePage[KeylessCertificate], - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=KeylessCertificate, - ) - - async def delete( - self, - keyless_certificate_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[KeylessCertificateDeleteResponse]: - """Removes a Keyless SSL configuration. - - SSL connections will no longer use the - keyless server for cryptographic operations. - - Args: - zone_id: Identifier. - - keyless_certificate_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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return await self._delete( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificateDeleteResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[KeylessCertificateDeleteResponse]], ResultWrapper[KeylessCertificateDeleteResponse] - ), - ) - - async def edit( - self, - keyless_certificate_id: str, - *, - zone_id: str, - enabled: bool | Omit = omit, - host: str | Omit = omit, - name: str | Omit = omit, - port: float | Omit = omit, - tunnel: TunnelParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[KeylessCertificate]: - """This will update attributes of a Keyless SSL. - - Consists of one or more of the - following: host,name,port. - - Args: - zone_id: Identifier. - - keyless_certificate_id: Identifier. - - enabled: Whether or not the Keyless SSL is on or off. - - host: The keyless SSL name. - - name: The keyless SSL name. - - port: The keyless SSL port used to communicate between Cloudflare and the client's - Keyless SSL server. - - tunnel: Configuration for using Keyless SSL through a Cloudflare Tunnel - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return await self._patch( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - body=await async_maybe_transform( - { - "enabled": enabled, - "host": host, - "name": name, - "port": port, - "tunnel": tunnel, - }, - keyless_certificate_edit_params.KeylessCertificateEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - async def get( - self, - keyless_certificate_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[KeylessCertificate]: - """ - Get details for one Keyless SSL configuration. - - Args: - zone_id: Identifier. - - keyless_certificate_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 keyless_certificate_id: - raise ValueError( - f"Expected a non-empty value for `keyless_certificate_id` but received {keyless_certificate_id!r}" - ) - return await self._get( - f"/zones/{zone_id}/keyless_certificates/{keyless_certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[KeylessCertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[KeylessCertificate]], ResultWrapper[KeylessCertificate]), - ) - - -class KeylessCertificatesResourceWithRawResponse: - def __init__(self, keyless_certificates: KeylessCertificatesResource) -> None: - self._keyless_certificates = keyless_certificates - - self.create = to_raw_response_wrapper( - keyless_certificates.create, - ) - self.list = to_raw_response_wrapper( - keyless_certificates.list, - ) - self.delete = to_raw_response_wrapper( - keyless_certificates.delete, - ) - self.edit = to_raw_response_wrapper( - keyless_certificates.edit, - ) - self.get = to_raw_response_wrapper( - keyless_certificates.get, - ) - - -class AsyncKeylessCertificatesResourceWithRawResponse: - def __init__(self, keyless_certificates: AsyncKeylessCertificatesResource) -> None: - self._keyless_certificates = keyless_certificates - - self.create = async_to_raw_response_wrapper( - keyless_certificates.create, - ) - self.list = async_to_raw_response_wrapper( - keyless_certificates.list, - ) - self.delete = async_to_raw_response_wrapper( - keyless_certificates.delete, - ) - self.edit = async_to_raw_response_wrapper( - keyless_certificates.edit, - ) - self.get = async_to_raw_response_wrapper( - keyless_certificates.get, - ) - - -class KeylessCertificatesResourceWithStreamingResponse: - def __init__(self, keyless_certificates: KeylessCertificatesResource) -> None: - self._keyless_certificates = keyless_certificates - - self.create = to_streamed_response_wrapper( - keyless_certificates.create, - ) - self.list = to_streamed_response_wrapper( - keyless_certificates.list, - ) - self.delete = to_streamed_response_wrapper( - keyless_certificates.delete, - ) - self.edit = to_streamed_response_wrapper( - keyless_certificates.edit, - ) - self.get = to_streamed_response_wrapper( - keyless_certificates.get, - ) - - -class AsyncKeylessCertificatesResourceWithStreamingResponse: - def __init__(self, keyless_certificates: AsyncKeylessCertificatesResource) -> None: - self._keyless_certificates = keyless_certificates - - self.create = async_to_streamed_response_wrapper( - keyless_certificates.create, - ) - self.list = async_to_streamed_response_wrapper( - keyless_certificates.list, - ) - self.delete = async_to_streamed_response_wrapper( - keyless_certificates.delete, - ) - self.edit = async_to_streamed_response_wrapper( - keyless_certificates.edit, - ) - self.get = async_to_streamed_response_wrapper( - keyless_certificates.get, - ) diff --git a/src/cloudflare/resources/keyless_certificates/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates/keyless_certificates.py index 242999090e8..7799dd675b2 100644 --- a/src/cloudflare/resources/keyless_certificates/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates/keyless_certificates.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> KeylessCertificatesResourceWithStreamingRes def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, host: str, port: float, @@ -97,8 +97,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -127,7 +125,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -149,8 +147,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -166,7 +162,7 @@ def delete( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -192,8 +188,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: @@ -222,7 +216,7 @@ def edit( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, host: str | Omit = omit, name: str | Omit = omit, @@ -264,8 +258,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: @@ -302,7 +294,7 @@ def get( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -326,8 +318,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: @@ -374,7 +364,7 @@ def with_streaming_response(self) -> AsyncKeylessCertificatesResourceWithStreami async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, host: str, port: float, @@ -419,8 +409,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -449,7 +437,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -471,8 +459,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -488,7 +474,7 @@ async def delete( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -514,8 +500,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: @@ -544,7 +528,7 @@ async def edit( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, host: str | Omit = omit, name: str | Omit = omit, @@ -586,8 +570,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: @@ -624,7 +606,7 @@ async def get( self, keyless_certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -648,8 +630,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not keyless_certificate_id: diff --git a/src/cloudflare/resources/kv/namespaces/keys.py b/src/cloudflare/resources/kv/namespaces/keys.py index f4f7d9d96ba..0eeb173d6ec 100644 --- a/src/cloudflare/resources/kv/namespaces/keys.py +++ b/src/cloudflare/resources/kv/namespaces/keys.py @@ -54,7 +54,7 @@ def list( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, limit: float | Omit = omit, prefix: str | Omit = omit, @@ -92,8 +92,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -127,7 +125,7 @@ def bulk_delete( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -154,8 +152,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -182,7 +178,7 @@ def bulk_get( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, keys: SequenceNotStr[str], type: Literal["text", "json"] | Omit = omit, with_metadata: bool | Omit = omit, @@ -218,8 +214,6 @@ def bulk_get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -258,7 +252,7 @@ def bulk_update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[key_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -289,8 +283,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -337,7 +329,7 @@ def list( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, limit: float | Omit = omit, prefix: str | Omit = omit, @@ -375,8 +367,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -410,7 +400,7 @@ async def bulk_delete( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -437,8 +427,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -465,7 +453,7 @@ async def bulk_get( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, keys: SequenceNotStr[str], type: Literal["text", "json"] | Omit = omit, with_metadata: bool | Omit = omit, @@ -501,8 +489,6 @@ async def bulk_get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -541,7 +527,7 @@ async def bulk_update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[key_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -572,8 +558,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: diff --git a/src/cloudflare/resources/kv/namespaces/metadata.py b/src/cloudflare/resources/kv/namespaces/metadata.py index 67d06c1c2f2..93427a658a2 100644 --- a/src/cloudflare/resources/kv/namespaces/metadata.py +++ b/src/cloudflare/resources/kv/namespaces/metadata.py @@ -46,7 +46,7 @@ def get( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -77,8 +77,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -127,7 +125,7 @@ async def get( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -158,8 +156,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: diff --git a/src/cloudflare/resources/kv/namespaces/namespaces.py b/src/cloudflare/resources/kv/namespaces/namespaces.py index 0b08cd9aebb..5fb71d4edd4 100644 --- a/src/cloudflare/resources/kv/namespaces/namespaces.py +++ b/src/cloudflare/resources/kv/namespaces/namespaces.py @@ -95,7 +95,7 @@ def with_streaming_response(self) -> NamespacesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, title: 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. @@ -123,8 +123,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -144,7 +142,7 @@ def update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, title: 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. @@ -171,8 +169,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -197,7 +193,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["id", "title"] | Omit = omit, page: float | Omit = omit, @@ -231,8 +227,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -260,7 +254,7 @@ def delete( self, namespace_id: str, *, - account_id: str | None = None, + account_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, @@ -284,8 +278,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -310,7 +302,7 @@ def bulk_delete( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -337,8 +329,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -364,7 +354,7 @@ def bulk_get( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, keys: SequenceNotStr[str], type: Literal["text", "json"] | Omit = omit, with_metadata: bool | Omit = omit, @@ -400,8 +390,6 @@ def bulk_get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -439,7 +427,7 @@ def bulk_update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[namespace_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -470,8 +458,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -497,7 +483,7 @@ def get( self, namespace_id: str, *, - account_id: str | None = None, + account_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, @@ -521,8 +507,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -579,7 +563,7 @@ def with_streaming_response(self) -> AsyncNamespacesResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, title: 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. @@ -607,8 +591,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -628,7 +610,7 @@ async def update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, title: 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. @@ -655,8 +637,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -681,7 +661,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["id", "title"] | Omit = omit, page: float | Omit = omit, @@ -715,8 +695,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -744,7 +722,7 @@ async def delete( self, namespace_id: str, *, - account_id: str | None = None, + account_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, @@ -768,8 +746,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -794,7 +770,7 @@ async def bulk_delete( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -821,8 +797,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -848,7 +822,7 @@ async def bulk_get( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, keys: SequenceNotStr[str], type: Literal["text", "json"] | Omit = omit, with_metadata: bool | Omit = omit, @@ -884,8 +858,6 @@ async def bulk_get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -923,7 +895,7 @@ async def bulk_update( self, namespace_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[namespace_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -954,8 +926,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -981,7 +951,7 @@ async def get( self, namespace_id: str, *, - account_id: str | None = None, + account_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, @@ -1005,8 +975,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: diff --git a/src/cloudflare/resources/kv/namespaces/values.py b/src/cloudflare/resources/kv/namespaces/values.py index fc7f52c7501..d9ddb7cd902 100644 --- a/src/cloudflare/resources/kv/namespaces/values.py +++ b/src/cloudflare/resources/kv/namespaces/values.py @@ -57,7 +57,7 @@ def update( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_id: str, value: Union[str, FileTypes], expiration: float | Omit = omit, @@ -106,8 +106,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -156,7 +154,7 @@ def delete( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -186,8 +184,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -215,7 +211,7 @@ def get( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -248,8 +244,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -295,7 +289,7 @@ async def update( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_id: str, value: Union[str, FileTypes], expiration: float | Omit = omit, @@ -344,8 +338,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -394,7 +386,7 @@ async def delete( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -424,8 +416,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: @@ -453,7 +443,7 @@ async def get( self, key_name: str, *, - account_id: str | None = None, + account_id: str, namespace_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. @@ -486,8 +476,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not namespace_id: diff --git a/src/cloudflare/resources/leaked_credential_checks/detections.py b/src/cloudflare/resources/leaked_credential_checks/detections.py index b79cddb1ba1..c287718e612 100644 --- a/src/cloudflare/resources/leaked_credential_checks/detections.py +++ b/src/cloudflare/resources/leaked_credential_checks/detections.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> DetectionsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, password: str | Omit = omit, username: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -106,7 +104,7 @@ def update( self, detection_id: str, *, - zone_id: str | None = None, + zone_id: str, password: str | Omit = omit, username: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -136,8 +134,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: @@ -168,7 +164,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -190,8 +186,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -207,7 +201,7 @@ def delete( self, detection_id: str, *, - zone_id: str | None = None, + 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, @@ -231,8 +225,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: @@ -257,7 +249,7 @@ def get( self, detection_id: str, *, - zone_id: str | None = None, + 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, @@ -281,8 +273,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: @@ -327,7 +317,7 @@ def with_streaming_response(self) -> AsyncDetectionsResourceWithStreamingRespons async def create( self, *, - zone_id: str | None = None, + zone_id: str, password: str | Omit = omit, username: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -355,8 +345,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -382,7 +370,7 @@ async def update( self, detection_id: str, *, - zone_id: str | None = None, + zone_id: str, password: str | Omit = omit, username: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -412,8 +400,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: @@ -444,7 +430,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -466,8 +452,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -483,7 +467,7 @@ async def delete( self, detection_id: str, *, - zone_id: str | None = None, + 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, @@ -507,8 +491,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: @@ -533,7 +515,7 @@ async def get( self, detection_id: str, *, - zone_id: str | None = None, + 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, @@ -557,8 +539,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not detection_id: diff --git a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py index f2cf987967d..58ff229c13d 100644 --- a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py +++ b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> LeakedCredentialChecksResourceWithStreaming def create( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,8 +87,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -109,7 +107,7 @@ def create( def get( self, *, - zone_id: str | None = None, + 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, @@ -131,8 +129,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -175,7 +171,7 @@ def with_streaming_response(self) -> AsyncLeakedCredentialChecksResourceWithStre async def create( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -200,8 +196,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -222,7 +216,7 @@ async def create( async def get( self, *, - zone_id: str | None = None, + 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, @@ -244,8 +238,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/load_balancers/load_balancers.py b/src/cloudflare/resources/load_balancers/load_balancers.py index d9319e6b9be..83f2ac5dd7c 100644 --- a/src/cloudflare/resources/load_balancers/load_balancers.py +++ b/src/cloudflare/resources/load_balancers/load_balancers.py @@ -135,7 +135,7 @@ def with_streaming_response(self) -> LoadBalancersResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, @@ -283,8 +283,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -326,7 +324,7 @@ def update( self, load_balancer_id: str, *, - zone_id: str | None = None, + zone_id: str, default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, @@ -477,8 +475,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -524,7 +520,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -544,8 +540,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -561,7 +555,7 @@ def delete( self, load_balancer_id: str, *, - zone_id: str | None = None, + 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, @@ -581,8 +575,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -605,7 +597,7 @@ def edit( self, load_balancer_id: str, *, - zone_id: str | None = None, + zone_id: str, adaptive_routing: AdaptiveRoutingParam | Omit = omit, country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, default_pools: SequenceNotStr[DefaultPools] | Omit = omit, @@ -753,8 +745,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -800,7 +790,7 @@ def get( self, load_balancer_id: str, *, - zone_id: str | None = None, + 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, @@ -820,8 +810,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -888,7 +876,7 @@ def with_streaming_response(self) -> AsyncLoadBalancersResourceWithStreamingResp async def create( self, *, - zone_id: str | None = None, + zone_id: str, default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, @@ -1036,8 +1024,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -1079,7 +1065,7 @@ async def update( self, load_balancer_id: str, *, - zone_id: str | None = None, + zone_id: str, default_pools: SequenceNotStr[DefaultPools], fallback_pool: str, name: str, @@ -1230,8 +1216,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -1277,7 +1261,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -1297,8 +1281,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -1314,7 +1296,7 @@ async def delete( self, load_balancer_id: str, *, - zone_id: str | None = None, + 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, @@ -1334,8 +1316,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -1358,7 +1338,7 @@ async def edit( self, load_balancer_id: str, *, - zone_id: str | None = None, + zone_id: str, adaptive_routing: AdaptiveRoutingParam | Omit = omit, country_pools: Dict[str, SequenceNotStr[str]] | Omit = omit, default_pools: SequenceNotStr[DefaultPools] | Omit = omit, @@ -1506,8 +1486,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: @@ -1553,7 +1531,7 @@ async def get( self, load_balancer_id: str, *, - zone_id: str | None = None, + 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, @@ -1573,8 +1551,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not load_balancer_id: diff --git a/src/cloudflare/resources/load_balancers/monitor_groups.py b/src/cloudflare/resources/load_balancers/monitor_groups.py index d6cf21a3630..97990a78f5c 100644 --- a/src/cloudflare/resources/load_balancers/monitor_groups.py +++ b/src/cloudflare/resources/load_balancers/monitor_groups.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> MonitorGroupsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_create_params.Member], @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -108,7 +106,7 @@ def update( self, monitor_group_id: str, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_update_params.Member], @@ -140,8 +138,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -173,7 +169,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -195,8 +191,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -212,7 +206,7 @@ def delete( self, monitor_group_id: str, *, - account_id: str | None = None, + account_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, @@ -234,8 +228,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -260,7 +252,7 @@ def edit( self, monitor_group_id: str, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_edit_params.Member], @@ -292,8 +284,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -326,7 +316,7 @@ def get( self, monitor_group_id: str, *, - account_id: str | None = None, + account_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, @@ -348,8 +338,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -394,7 +382,7 @@ def with_streaming_response(self) -> AsyncMonitorGroupsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_create_params.Member], @@ -426,8 +414,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -454,7 +440,7 @@ async def update( self, monitor_group_id: str, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_update_params.Member], @@ -486,8 +472,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -519,7 +503,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -541,8 +525,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -558,7 +540,7 @@ async def delete( self, monitor_group_id: str, *, - account_id: str | None = None, + account_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, @@ -580,8 +562,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -606,7 +586,7 @@ async def edit( self, monitor_group_id: str, *, - account_id: str | None = None, + account_id: str, id: str, description: str, members: Iterable[monitor_group_edit_params.Member], @@ -638,8 +618,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: @@ -672,7 +650,7 @@ async def get( self, monitor_group_id: str, *, - account_id: str | None = None, + account_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, @@ -694,8 +672,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_group_id: diff --git a/src/cloudflare/resources/load_balancers/monitors/monitors.py b/src/cloudflare/resources/load_balancers/monitors/monitors.py index db84661e49b..321c38845c0 100644 --- a/src/cloudflare/resources/load_balancers/monitors/monitors.py +++ b/src/cloudflare/resources/load_balancers/monitors/monitors.py @@ -74,7 +74,7 @@ def with_streaming_response(self) -> MonitorsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -161,8 +161,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -202,7 +200,7 @@ def update( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -289,8 +287,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -335,7 +331,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -357,8 +353,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -374,7 +368,7 @@ def delete( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -396,8 +390,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -422,7 +414,7 @@ def edit( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -509,8 +501,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -556,7 +546,7 @@ def get( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -578,8 +568,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -632,7 +620,7 @@ def with_streaming_response(self) -> AsyncMonitorsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -719,8 +707,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -760,7 +746,7 @@ async def update( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -847,8 +833,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -893,7 +877,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -915,8 +899,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -932,7 +914,7 @@ async def delete( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -954,8 +936,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -980,7 +960,7 @@ async def edit( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -1067,8 +1047,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -1114,7 +1092,7 @@ async def get( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -1136,8 +1114,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: diff --git a/src/cloudflare/resources/load_balancers/monitors/previews.py b/src/cloudflare/resources/load_balancers/monitors/previews.py index ca932df4519..aa3c7720399 100644 --- a/src/cloudflare/resources/load_balancers/monitors/previews.py +++ b/src/cloudflare/resources/load_balancers/monitors/previews.py @@ -49,7 +49,7 @@ def create( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -138,8 +138,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -206,7 +204,7 @@ async def create( self, monitor_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -295,8 +293,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: diff --git a/src/cloudflare/resources/load_balancers/monitors/references.py b/src/cloudflare/resources/load_balancers/monitors/references.py index dd0b765215f..9718c159864 100644 --- a/src/cloudflare/resources/load_balancers/monitors/references.py +++ b/src/cloudflare/resources/load_balancers/monitors/references.py @@ -45,7 +45,7 @@ def get( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: @@ -111,7 +109,7 @@ def get( self, monitor_id: str, *, - account_id: str | None = None, + account_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, @@ -133,8 +131,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not monitor_id: diff --git a/src/cloudflare/resources/load_balancers/pools/health.py b/src/cloudflare/resources/load_balancers/pools/health.py index 474673a360e..57059149156 100644 --- a/src/cloudflare/resources/load_balancers/pools/health.py +++ b/src/cloudflare/resources/load_balancers/pools/health.py @@ -50,7 +50,7 @@ def create( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -139,8 +139,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -184,7 +182,7 @@ def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -206,8 +204,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -251,7 +247,7 @@ async def create( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, allow_insecure: bool | Omit = omit, consecutive_down: int | Omit = omit, consecutive_up: int | Omit = omit, @@ -340,8 +336,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -385,7 +379,7 @@ async def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -407,8 +401,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: diff --git a/src/cloudflare/resources/load_balancers/pools/pools.py b/src/cloudflare/resources/load_balancers/pools/pools.py index 9762e7550e4..e3183700cef 100644 --- a/src/cloudflare/resources/load_balancers/pools/pools.py +++ b/src/cloudflare/resources/load_balancers/pools/pools.py @@ -85,7 +85,7 @@ def with_streaming_response(self) -> PoolsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, origins: Iterable[OriginParam], description: str | Omit = omit, @@ -162,8 +162,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -200,7 +198,7 @@ def update( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, name: str, origins: Iterable[OriginParam], check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -281,8 +279,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -323,7 +319,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, monitor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -349,8 +345,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -370,7 +364,7 @@ def delete( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -392,8 +386,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -415,7 +407,7 @@ def delete( def bulk_edit( self, *, - account_id: str | None = None, + account_id: str, notification_email: Literal[""] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -446,8 +438,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -465,7 +455,7 @@ def edit( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -546,8 +536,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -589,7 +577,7 @@ def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -611,8 +599,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -663,7 +649,7 @@ def with_streaming_response(self) -> AsyncPoolsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, origins: Iterable[OriginParam], description: str | Omit = omit, @@ -740,8 +726,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -778,7 +762,7 @@ async def update( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, name: str, origins: Iterable[OriginParam], check_regions: Optional[List[CheckRegion]] | Omit = omit, @@ -859,8 +843,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -901,7 +883,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, monitor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -927,8 +909,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -948,7 +928,7 @@ async def delete( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -970,8 +950,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -993,7 +971,7 @@ async def delete( def bulk_edit( self, *, - account_id: str | None = None, + account_id: str, notification_email: Literal[""] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1024,8 +1002,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -1043,7 +1019,7 @@ async def edit( self, pool_id: str, *, - account_id: str | None = None, + account_id: str, check_regions: Optional[List[CheckRegion]] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -1124,8 +1100,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -1167,7 +1141,7 @@ async def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -1189,8 +1163,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: diff --git a/src/cloudflare/resources/load_balancers/pools/references.py b/src/cloudflare/resources/load_balancers/pools/references.py index 4932ea6649a..f76aa9c8d01 100644 --- a/src/cloudflare/resources/load_balancers/pools/references.py +++ b/src/cloudflare/resources/load_balancers/pools/references.py @@ -45,7 +45,7 @@ def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: @@ -111,7 +109,7 @@ def get( self, pool_id: str, *, - account_id: str | None = None, + account_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, @@ -133,8 +131,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pool_id: diff --git a/src/cloudflare/resources/load_balancers/previews.py b/src/cloudflare/resources/load_balancers/previews.py index 2c37559665a..5723404ad09 100644 --- a/src/cloudflare/resources/load_balancers/previews.py +++ b/src/cloudflare/resources/load_balancers/previews.py @@ -47,7 +47,7 @@ def get( self, preview_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not preview_id: @@ -116,7 +114,7 @@ async def get( self, preview_id: str, *, - account_id: str | None = None, + account_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, @@ -138,8 +136,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not preview_id: diff --git a/src/cloudflare/resources/load_balancers/regions.py b/src/cloudflare/resources/load_balancers/regions.py index 72b6891971e..7a2c0950194 100644 --- a/src/cloudflare/resources/load_balancers/regions.py +++ b/src/cloudflare/resources/load_balancers/regions.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> RegionsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, country_code_a2: str | Omit = omit, subdivision_code: str | Omit = omit, subdivision_code_a2: str | Omit = omit, @@ -80,8 +80,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -115,7 +113,7 @@ def get( "WNAM", "ENAM", "WEU", "EEU", "NSAM", "SSAM", "OC", "ME", "NAF", "SAF", "SAS", "SEAS", "NEAS" ], *, - account_id: str | None = None, + account_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, @@ -143,8 +141,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not region_id: @@ -194,7 +190,7 @@ def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_id: str, country_code_a2: str | Omit = omit, subdivision_code: str | Omit = omit, subdivision_code_a2: str | Omit = omit, @@ -225,8 +221,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -260,7 +254,7 @@ async def get( "WNAM", "ENAM", "WEU", "EEU", "NSAM", "SSAM", "OC", "ME", "NAF", "SAF", "SAS", "SEAS", "NEAS" ], *, - account_id: str | None = None, + account_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, @@ -288,8 +282,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not region_id: diff --git a/src/cloudflare/resources/load_balancers/searches.py b/src/cloudflare/resources/load_balancers/searches.py index 9b254b09b36..6d041dc8c3d 100644 --- a/src/cloudflare/resources/load_balancers/searches.py +++ b/src/cloudflare/resources/load_balancers/searches.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SearchesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, query: str | Omit = omit, @@ -78,8 +78,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -127,7 +125,7 @@ def with_streaming_response(self) -> AsyncSearchesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, query: str | Omit = omit, @@ -158,8 +156,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/logpush/datasets/fields.py b/src/cloudflare/resources/logpush/datasets/fields.py index 9e49fbc0cad..48954e81745 100644 --- a/src/cloudflare/resources/logpush/datasets/fields.py +++ b/src/cloudflare/resources/logpush/datasets/fields.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import path_template from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -58,6 +58,7 @@ def get( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -79,8 +80,8 @@ def get( "zero_trust_network_sessions", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -111,10 +112,6 @@ def get( """ if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -180,6 +177,7 @@ async def get( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -201,8 +199,8 @@ async def get( "zero_trust_network_sessions", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -233,10 +231,6 @@ async def get( """ if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/logpush/datasets/jobs.py b/src/cloudflare/resources/logpush/datasets/jobs.py index 5cbac38c0aa..c623a730e36 100644 --- a/src/cloudflare/resources/logpush/datasets/jobs.py +++ b/src/cloudflare/resources/logpush/datasets/jobs.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import path_template from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -59,6 +59,7 @@ def get( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -80,8 +81,8 @@ def get( "zero_trust_network_sessions", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -110,10 +111,6 @@ def get( """ if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -176,6 +173,7 @@ def get( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -197,8 +195,8 @@ def get( "zero_trust_network_sessions", ], *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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,10 +225,6 @@ def get( """ if not dataset_id: raise ValueError(f"Expected a non-empty value for `dataset_id` but received {dataset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/logpush/edge.py b/src/cloudflare/resources/logpush/edge.py index 5192b93cf87..86cc292dc41 100644 --- a/src/cloudflare/resources/logpush/edge.py +++ b/src/cloudflare/resources/logpush/edge.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> EdgeResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, fields: str | Omit = omit, filter: str | Omit = omit, sample: int | Omit = omit, @@ -81,8 +81,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -108,7 +106,7 @@ def create( def get( self, *, - zone_id: str | None = None, + 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, @@ -130,8 +128,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -167,7 +163,7 @@ def with_streaming_response(self) -> AsyncEdgeResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, fields: str | Omit = omit, filter: str | Omit = omit, sample: int | Omit = omit, @@ -200,8 +196,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -227,7 +221,7 @@ async def create( def get( self, *, - zone_id: str | None = None, + 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, @@ -249,8 +243,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/logpush/jobs.py b/src/cloudflare/resources/logpush/jobs.py index 923de998f9c..a4740ade39e 100644 --- a/src/cloudflare/resources/logpush/jobs.py +++ b/src/cloudflare/resources/logpush/jobs.py @@ -52,8 +52,8 @@ def create( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dataset: Optional[ Literal[ "access_requests", @@ -68,6 +68,7 @@ def create( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -175,10 +176,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -229,8 +226,8 @@ def update( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, destination_conf: str | Omit = omit, enabled: bool | Omit = omit, filter: Optional[str] | Omit = omit, @@ -316,10 +313,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -369,8 +362,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -394,10 +387,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -427,8 +416,8 @@ def delete( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -454,10 +443,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -491,8 +476,8 @@ def get( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -518,10 +503,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -576,8 +557,8 @@ async def create( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dataset: Optional[ Literal[ "access_requests", @@ -592,6 +573,7 @@ async def create( "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", @@ -699,10 +681,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -753,8 +731,8 @@ async def update( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, destination_conf: str | Omit = omit, enabled: bool | Omit = omit, filter: Optional[str] | Omit = omit, @@ -840,10 +818,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -893,8 +867,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -918,10 +892,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -951,8 +921,8 @@ async def delete( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -978,10 +948,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1015,8 +981,8 @@ async def get( self, job_id: int, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1042,10 +1008,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/logpush/ownership.py b/src/cloudflare/resources/logpush/ownership.py index 885a81f6f34..7e2c54888f8 100644 --- a/src/cloudflare/resources/logpush/ownership.py +++ b/src/cloudflare/resources/logpush/ownership.py @@ -6,7 +6,7 @@ import httpx -from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -49,8 +49,8 @@ def create( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,10 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -116,8 +112,8 @@ def validate( *, destination_conf: str, ownership_challenge: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -147,10 +143,6 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -211,8 +203,8 @@ async def create( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -240,10 +232,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -280,8 +268,8 @@ async def validate( *, destination_conf: str, ownership_challenge: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -311,10 +299,6 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/logpush/validate.py b/src/cloudflare/resources/logpush/validate.py index cc6981edc98..ff7c93dd9c1 100644 --- a/src/cloudflare/resources/logpush/validate.py +++ b/src/cloudflare/resources/logpush/validate.py @@ -6,7 +6,7 @@ import httpx -from ..._types import Body, Query, Headers, NotGiven, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -50,8 +50,8 @@ def destination( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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,10 +79,6 @@ def destination( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -118,8 +114,8 @@ def destination_exists( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -147,10 +143,6 @@ def destination_exists( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -189,8 +181,8 @@ def origin( self, *, logpull_options: Optional[str], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -220,10 +212,6 @@ def origin( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -278,8 +266,8 @@ async def destination( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -307,10 +295,6 @@ async def destination( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -346,8 +330,8 @@ async def destination_exists( self, *, destination_conf: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -375,10 +359,6 @@ async def destination_exists( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -417,8 +397,8 @@ async def origin( self, *, logpull_options: Optional[str], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -448,10 +428,6 @@ async def origin( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/logs/control/cmb/config.py b/src/cloudflare/resources/logs/control/cmb/config.py index d53e71c87a8..2830135d632 100644 --- a/src/cloudflare/resources/logs/control/cmb/config.py +++ b/src/cloudflare/resources/logs/control/cmb/config.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, allow_out_of_region_access: bool | Omit = omit, regions: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -101,7 +99,7 @@ def create( def delete( self, *, - account_id: str | None = None, + account_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, @@ -123,8 +121,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -142,7 +138,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -164,8 +160,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -204,7 +198,7 @@ def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, allow_out_of_region_access: bool | Omit = omit, regions: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -232,8 +226,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -258,7 +250,7 @@ async def create( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -280,8 +272,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -299,7 +289,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_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, @@ -321,8 +311,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/logs/control/retention.py b/src/cloudflare/resources/logs/control/retention.py index 01b35db235a..0128e3ee3cf 100644 --- a/src/cloudflare/resources/logs/control/retention.py +++ b/src/cloudflare/resources/logs/control/retention.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> RetentionResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, flag: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,8 +73,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -93,7 +91,7 @@ def create( def get( self, *, - zone_id: str | None = None, + 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, @@ -115,8 +113,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -155,7 +151,7 @@ def with_streaming_response(self) -> AsyncRetentionResourceWithStreamingResponse async def create( self, *, - zone_id: str | None = None, + zone_id: str, flag: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -180,8 +176,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -200,7 +194,7 @@ async def create( async def get( self, *, - zone_id: str | None = None, + 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, @@ -222,8 +216,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/logs/rayid.py b/src/cloudflare/resources/logs/rayid.py index 04c04f19bc6..96898385a63 100644 --- a/src/cloudflare/resources/logs/rayid.py +++ b/src/cloudflare/resources/logs/rayid.py @@ -48,7 +48,7 @@ def get( self, rayid: str, *, - zone_id: str | None = None, + zone_id: str, fields: str | Omit = omit, timestamps: Literal["unix", "unixnano", "rfc3339"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -94,8 +94,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rayid: @@ -146,7 +144,7 @@ async def get( self, rayid: str, *, - zone_id: str | None = None, + zone_id: str, fields: str | Omit = omit, timestamps: Literal["unix", "unixnano", "rfc3339"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -192,8 +190,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rayid: diff --git a/src/cloudflare/resources/logs/received/fields.py b/src/cloudflare/resources/logs/received/fields.py index f7534c173e7..d61a698275d 100644 --- a/src/cloudflare/resources/logs/received/fields.py +++ b/src/cloudflare/resources/logs/received/fields.py @@ -43,7 +43,7 @@ def with_streaming_response(self) -> FieldsResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -103,7 +101,7 @@ def with_streaming_response(self) -> AsyncFieldsResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -127,8 +125,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/logs/received/received.py b/src/cloudflare/resources/logs/received/received.py index f2ed529b10f..ac0bb137afa 100644 --- a/src/cloudflare/resources/logs/received/received.py +++ b/src/cloudflare/resources/logs/received/received.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> ReceivedResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + zone_id: str, end: Union[str, int], count: int | Omit = omit, fields: str | Omit = omit, @@ -137,8 +137,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -196,7 +194,7 @@ def with_streaming_response(self) -> AsyncReceivedResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + zone_id: str, end: Union[str, int], count: int | Omit = omit, fields: str | Omit = omit, @@ -274,8 +272,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( diff --git a/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/catalog_syncs.py b/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/catalog_syncs.py index 678a34d42a6..71e11119d11 100644 --- a/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/catalog_syncs.py +++ b/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/catalog_syncs.py @@ -72,7 +72,7 @@ def with_streaming_response(self) -> CatalogSyncsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, destination_type: Literal["NONE", "ZERO_TRUST_LIST"], name: str, update_mode: Literal["AUTO", "MANUAL"], @@ -98,8 +98,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -129,7 +127,7 @@ def update( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, policy: str | Omit = omit, @@ -153,8 +151,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -185,7 +181,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -205,8 +201,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -222,7 +216,7 @@ def delete( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, delete_destination: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -243,8 +237,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -270,7 +262,7 @@ def edit( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, policy: str | Omit = omit, @@ -294,8 +286,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -327,7 +317,7 @@ def get( self, sync_id: str, *, - account_id: str | None = None, + account_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, @@ -347,8 +337,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -371,7 +359,7 @@ def refresh( self, sync_id: str, *, - account_id: str | None = None, + account_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, @@ -392,8 +380,6 @@ def refresh( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -442,7 +428,7 @@ def with_streaming_response(self) -> AsyncCatalogSyncsResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, destination_type: Literal["NONE", "ZERO_TRUST_LIST"], name: str, update_mode: Literal["AUTO", "MANUAL"], @@ -468,8 +454,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -499,7 +483,7 @@ async def update( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, policy: str | Omit = omit, @@ -523,8 +507,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -555,7 +537,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -575,8 +557,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -592,7 +572,7 @@ async def delete( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, delete_destination: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -613,8 +593,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -640,7 +618,7 @@ async def edit( self, sync_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, name: str | Omit = omit, policy: str | Omit = omit, @@ -664,8 +642,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -697,7 +673,7 @@ async def get( self, sync_id: str, *, - account_id: str | None = None, + account_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, @@ -717,8 +693,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: @@ -741,7 +715,7 @@ async def refresh( self, sync_id: str, *, - account_id: str | None = None, + account_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, @@ -762,8 +736,6 @@ async def refresh( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sync_id: diff --git a/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/prebuilt_policies.py b/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/prebuilt_policies.py index 84fe5ec8847..bd08faf33cb 100644 --- a/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/prebuilt_policies.py +++ b/src/cloudflare/resources/magic_cloud_networking/catalog_syncs/prebuilt_policies.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PrebuiltPoliciesResourceWithStreamingRespon def list( self, *, - account_id: str | None = None, + account_id: str, destination_type: Literal["NONE", "ZERO_TRUST_LIST"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncPrebuiltPoliciesResourceWithStreamingR def list( self, *, - account_id: str | None = None, + account_id: str, destination_type: Literal["NONE", "ZERO_TRUST_LIST"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py b/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py index 1fa5f85013d..8b5474725ba 100644 --- a/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py +++ b/src/cloudflare/resources/magic_cloud_networking/cloud_integrations.py @@ -66,7 +66,7 @@ def with_streaming_response(self) -> CloudIntegrationsResourceWithStreamingRespo def create( self, *, - account_id: str | None = None, + account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"], friendly_name: str, description: str | Omit = omit, @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -119,7 +117,7 @@ def update( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, aws_arn: str | Omit = omit, azure_subscription_id: str | Omit = omit, azure_tenant_id: str | Omit = omit, @@ -146,8 +144,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -183,7 +179,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, cloudflare: bool | Omit = omit, desc: bool | Omit = omit, order_by: str | Omit = omit, @@ -209,8 +205,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -238,7 +232,7 @@ def delete( self, provider_id: str, *, - account_id: str | None = None, + account_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, @@ -258,8 +252,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -284,7 +276,7 @@ def discover( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, v2: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -305,8 +297,6 @@ def discover( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -330,7 +320,7 @@ def discover( def discover_all( self, *, - account_id: str | None = None, + account_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, @@ -350,8 +340,6 @@ def discover_all( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -366,7 +354,7 @@ def edit( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, aws_arn: str | Omit = omit, azure_subscription_id: str | Omit = omit, azure_tenant_id: str | Omit = omit, @@ -393,8 +381,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -431,7 +417,7 @@ def get( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, status: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -452,8 +438,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -479,7 +463,7 @@ def initial_setup( self, provider_id: str, *, - account_id: str | None = None, + account_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, @@ -499,8 +483,6 @@ def initial_setup( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -550,7 +532,7 @@ def with_streaming_response(self) -> AsyncCloudIntegrationsResourceWithStreaming async def create( self, *, - account_id: str | None = None, + account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"], friendly_name: str, description: str | Omit = omit, @@ -574,8 +556,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -603,7 +583,7 @@ async def update( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, aws_arn: str | Omit = omit, azure_subscription_id: str | Omit = omit, azure_tenant_id: str | Omit = omit, @@ -630,8 +610,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -667,7 +645,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, cloudflare: bool | Omit = omit, desc: bool | Omit = omit, order_by: str | Omit = omit, @@ -693,8 +671,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -722,7 +698,7 @@ async def delete( self, provider_id: str, *, - account_id: str | None = None, + account_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, @@ -742,8 +718,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -768,7 +742,7 @@ async def discover( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, v2: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -789,8 +763,6 @@ async def discover( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -816,7 +788,7 @@ async def discover( async def discover_all( self, *, - account_id: str | None = None, + account_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, @@ -836,8 +808,6 @@ async def discover_all( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -852,7 +822,7 @@ async def edit( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, aws_arn: str | Omit = omit, azure_subscription_id: str | Omit = omit, azure_tenant_id: str | Omit = omit, @@ -879,8 +849,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -917,7 +885,7 @@ async def get( self, provider_id: str, *, - account_id: str | None = None, + account_id: str, status: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -938,8 +906,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: @@ -967,7 +933,7 @@ async def initial_setup( self, provider_id: str, *, - account_id: str | None = None, + account_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, @@ -987,8 +953,6 @@ async def initial_setup( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not provider_id: diff --git a/src/cloudflare/resources/magic_cloud_networking/on_ramps/address_spaces.py b/src/cloudflare/resources/magic_cloud_networking/on_ramps/address_spaces.py index 846e7dd8cd7..1a79fe310fc 100644 --- a/src/cloudflare/resources/magic_cloud_networking/on_ramps/address_spaces.py +++ b/src/cloudflare/resources/magic_cloud_networking/on_ramps/address_spaces.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> AddressSpacesResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, prefixes: SequenceNotStr[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. @@ -70,8 +70,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -90,7 +88,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -110,8 +108,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -129,7 +125,7 @@ def list( def edit( self, *, - account_id: str | None = None, + account_id: str, prefixes: SequenceNotStr[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. @@ -150,8 +146,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -191,7 +185,7 @@ def with_streaming_response(self) -> AsyncAddressSpacesResourceWithStreamingResp async def update( self, *, - account_id: str | None = None, + account_id: str, prefixes: SequenceNotStr[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. @@ -212,8 +206,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -234,7 +226,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_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, @@ -254,8 +246,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -273,7 +263,7 @@ async def list( async def edit( self, *, - account_id: str | None = None, + account_id: str, prefixes: SequenceNotStr[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. @@ -294,8 +284,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( diff --git a/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py b/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py index be648372058..aef7640bfba 100644 --- a/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py +++ b/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py @@ -83,7 +83,7 @@ def with_streaming_response(self) -> OnRampsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE"], dynamic_routing: bool, install_routes_in_cloud: bool, @@ -125,8 +125,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -167,7 +165,7 @@ def update( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, attached_hubs: SequenceNotStr[str] | Omit = omit, attached_vpcs: SequenceNotStr[str] | Omit = omit, description: str | Omit = omit, @@ -196,8 +194,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -233,7 +229,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, desc: bool | Omit = omit, order_by: str | Omit = omit, status: bool | Omit = omit, @@ -259,8 +255,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -288,7 +282,7 @@ def delete( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, destroy: bool | Omit = omit, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -310,8 +304,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -341,7 +333,7 @@ def apply( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -361,8 +353,6 @@ def apply( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -383,7 +373,7 @@ def edit( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, attached_hubs: SequenceNotStr[str] | Omit = omit, attached_vpcs: SequenceNotStr[str] | Omit = omit, description: str | Omit = omit, @@ -412,8 +402,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -450,7 +438,7 @@ def export( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -470,8 +458,6 @@ def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -493,7 +479,7 @@ def get( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, planned_resources: bool | Omit = omit, post_apply_resources: bool | Omit = omit, status: bool | Omit = omit, @@ -517,8 +503,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -550,7 +534,7 @@ def plan( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -570,8 +554,6 @@ def plan( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -616,7 +598,7 @@ def with_streaming_response(self) -> AsyncOnRampsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, cloud_type: Literal["AWS", "AZURE", "GOOGLE"], dynamic_routing: bool, install_routes_in_cloud: bool, @@ -658,8 +640,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"forwarded": forwarded}), **(extra_headers or {})} @@ -700,7 +680,7 @@ async def update( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, attached_hubs: SequenceNotStr[str] | Omit = omit, attached_vpcs: SequenceNotStr[str] | Omit = omit, description: str | Omit = omit, @@ -729,8 +709,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -766,7 +744,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, desc: bool | Omit = omit, order_by: str | Omit = omit, status: bool | Omit = omit, @@ -792,8 +770,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -821,7 +797,7 @@ async def delete( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, destroy: bool | Omit = omit, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -843,8 +819,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -874,7 +848,7 @@ async def apply( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -894,8 +868,6 @@ async def apply( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -916,7 +888,7 @@ async def edit( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, attached_hubs: SequenceNotStr[str] | Omit = omit, attached_vpcs: SequenceNotStr[str] | Omit = omit, description: str | Omit = omit, @@ -945,8 +917,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -983,7 +953,7 @@ async def export( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -1003,8 +973,6 @@ async def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -1026,7 +994,7 @@ async def get( self, onramp_id: str, *, - account_id: str | None = None, + account_id: str, planned_resources: bool | Omit = omit, post_apply_resources: bool | Omit = omit, status: bool | Omit = omit, @@ -1050,8 +1018,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: @@ -1083,7 +1049,7 @@ async def plan( self, onramp_id: str, *, - account_id: str | None = None, + account_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, @@ -1103,8 +1069,6 @@ async def plan( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not onramp_id: diff --git a/src/cloudflare/resources/magic_cloud_networking/resources.py b/src/cloudflare/resources/magic_cloud_networking/resources.py index 34bf58ff884..bf3ddc2c1ef 100644 --- a/src/cloudflare/resources/magic_cloud_networking/resources.py +++ b/src/cloudflare/resources/magic_cloud_networking/resources.py @@ -64,7 +64,7 @@ def with_streaming_response(self) -> ResourcesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, cloudflare: bool | Omit = omit, desc: bool | Omit = omit, managed: bool | Omit = omit, @@ -160,8 +160,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -197,7 +195,7 @@ def list( def export( self, *, - account_id: str | None = None, + account_id: str, desc: bool | Omit = omit, order_by: str | Omit = omit, provider_id: str | Omit = omit, @@ -289,8 +287,6 @@ def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} @@ -323,7 +319,7 @@ def get( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, v2: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -344,8 +340,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_id: @@ -370,7 +364,7 @@ def get( def policy_preview( self, *, - account_id: str | None = None, + account_id: str, policy: 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. @@ -391,8 +385,6 @@ def policy_preview( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -432,7 +424,7 @@ def with_streaming_response(self) -> AsyncResourcesResourceWithStreamingResponse def list( self, *, - account_id: str | None = None, + account_id: str, cloudflare: bool | Omit = omit, desc: bool | Omit = omit, managed: bool | Omit = omit, @@ -528,8 +520,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -565,7 +555,7 @@ def list( async def export( self, *, - account_id: str | None = None, + account_id: str, desc: bool | Omit = omit, order_by: str | Omit = omit, provider_id: str | Omit = omit, @@ -657,8 +647,6 @@ async def export( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} @@ -691,7 +679,7 @@ async def get( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, v2: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -712,8 +700,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not resource_id: @@ -738,7 +724,7 @@ async def get( async def policy_preview( self, *, - account_id: str | None = None, + account_id: str, policy: 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. @@ -759,8 +745,6 @@ async def policy_preview( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index f54c165103d..133f41dea62 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float, name: str, router_ips: SequenceNotStr[str] | Omit = omit, @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -116,7 +114,7 @@ def create( def update( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float, name: str, router_ips: SequenceNotStr[str] | Omit = omit, @@ -146,8 +144,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -174,7 +170,7 @@ def update( def delete( self, *, - account_id: str | None = None, + account_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, @@ -194,8 +190,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -213,7 +207,7 @@ def delete( def edit( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float | Omit = omit, name: str | Omit = omit, router_ips: SequenceNotStr[str] | Omit = omit, @@ -242,8 +236,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -270,7 +262,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -290,8 +282,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -334,7 +324,7 @@ def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float, name: str, router_ips: SequenceNotStr[str] | Omit = omit, @@ -363,8 +353,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -391,7 +379,7 @@ async def create( async def update( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float, name: str, router_ips: SequenceNotStr[str] | Omit = omit, @@ -421,8 +409,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -449,7 +435,7 @@ async def update( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -469,8 +455,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -488,7 +472,7 @@ async def delete( async def edit( self, *, - account_id: str | None = None, + account_id: str, default_sampling: float | Omit = omit, name: str | Omit = omit, router_ips: SequenceNotStr[str] | Omit = omit, @@ -517,8 +501,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -545,7 +527,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -565,8 +547,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py index 197ae7ad775..d5efe5634ec 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> FullResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -66,8 +66,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -106,7 +104,7 @@ def with_streaming_response(self) -> AsyncFullResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -126,8 +124,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py index 9c0d8320f16..8324bd8b499 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py @@ -48,7 +48,7 @@ def edit( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -118,7 +116,7 @@ async def edit( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -142,8 +140,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py index 3a0f753b0ee..6d7843ee157 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py @@ -61,7 +61,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -120,8 +120,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -154,7 +152,7 @@ def create( def update( self, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -211,8 +209,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -245,7 +241,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -265,8 +261,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -282,7 +276,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -304,8 +298,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -326,7 +318,7 @@ def edit( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -385,8 +377,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -422,7 +412,7 @@ def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -444,8 +434,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -490,7 +478,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -549,8 +537,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -583,7 +569,7 @@ async def create( async def update( self, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -640,8 +626,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -674,7 +658,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -694,8 +678,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -711,7 +693,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -733,8 +715,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -755,7 +735,7 @@ async def edit( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, automatic_advertisement: Optional[bool], name: str, prefixes: SequenceNotStr[str], @@ -814,8 +794,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -851,7 +829,7 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -873,8 +851,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py b/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py index ed5eef93cb2..866c36e5963 100644 --- a/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py +++ b/src/cloudflare/resources/magic_network_monitoring/vpc_flows/tokens.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> TokensResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_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, @@ -66,8 +66,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -106,7 +104,7 @@ def with_streaming_response(self) -> AsyncTokensResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_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, @@ -126,8 +124,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/magic_transit/apps.py b/src/cloudflare/resources/magic_transit/apps.py index a3886e62e6b..6ab86b1c73d 100644 --- a/src/cloudflare/resources/magic_transit/apps.py +++ b/src/cloudflare/resources/magic_transit/apps.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, type: str, hostnames: SequenceNotStr[str] | Omit = omit, @@ -91,8 +91,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -121,7 +119,7 @@ def update( self, account_app_id: str, *, - account_id: str | None = None, + account_id: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, @@ -162,8 +160,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: @@ -197,7 +193,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -219,8 +215,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -236,7 +230,7 @@ def delete( self, account_app_id: str, *, - account_id: str | None = None, + account_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, @@ -260,8 +254,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: @@ -286,7 +278,7 @@ def edit( self, account_app_id: str, *, - account_id: str | None = None, + account_id: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, @@ -327,8 +319,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: @@ -383,7 +373,7 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, type: str, hostnames: SequenceNotStr[str] | Omit = omit, @@ -422,8 +412,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -452,7 +440,7 @@ async def update( self, account_app_id: str, *, - account_id: str | None = None, + account_id: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, @@ -493,8 +481,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: @@ -528,7 +514,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -550,8 +536,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -567,7 +551,7 @@ async def delete( self, account_app_id: str, *, - account_id: str | None = None, + account_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, @@ -591,8 +575,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: @@ -617,7 +599,7 @@ async def edit( self, account_app_id: str, *, - account_id: str | None = None, + account_id: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, @@ -658,8 +640,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not account_app_id: diff --git a/src/cloudflare/resources/magic_transit/cf_interconnects.py b/src/cloudflare/resources/magic_transit/cf_interconnects.py index c7d150e084c..f2e3ef1890e 100644 --- a/src/cloudflare/resources/magic_transit/cf_interconnects.py +++ b/src/cloudflare/resources/magic_transit/cf_interconnects.py @@ -52,7 +52,7 @@ def update( self, cf_interconnect_id: str, *, - account_id: str | None = None, + account_id: str, automatic_return_routing: bool | Omit = omit, description: str | Omit = omit, gre: cf_interconnect_update_params.GRE | Omit = omit, @@ -109,8 +109,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cf_interconnect_id: @@ -157,7 +155,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -180,8 +178,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -209,7 +205,7 @@ def list( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -236,8 +232,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -267,7 +261,7 @@ def get( self, cf_interconnect_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -292,8 +286,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cf_interconnect_id: @@ -349,7 +341,7 @@ async def update( self, cf_interconnect_id: str, *, - account_id: str | None = None, + account_id: str, automatic_return_routing: bool | Omit = omit, description: str | Omit = omit, gre: cf_interconnect_update_params.GRE | Omit = omit, @@ -406,8 +398,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cf_interconnect_id: @@ -454,7 +444,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -477,8 +467,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -506,7 +494,7 @@ async def list( async def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -533,8 +521,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -564,7 +550,7 @@ async def get( self, cf_interconnect_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -589,8 +575,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cf_interconnect_id: diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py index 86b9c801045..d842d3ecd80 100644 --- a/src/cloudflare/resources/magic_transit/connectors/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -78,7 +78,7 @@ def with_streaming_response(self) -> ConnectorsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, device: connector_create_params.Device, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ @@ -117,8 +117,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -150,7 +148,7 @@ def update( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] @@ -189,8 +187,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -227,7 +223,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -249,8 +245,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -266,7 +260,7 @@ def delete( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -288,8 +282,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -314,7 +306,7 @@ def edit( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] @@ -353,8 +345,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -392,7 +382,7 @@ def get( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -414,8 +404,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -468,7 +456,7 @@ def with_streaming_response(self) -> AsyncConnectorsResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, device: connector_create_params.Device, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ @@ -507,8 +495,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -540,7 +526,7 @@ async def update( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] @@ -579,8 +565,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -617,7 +601,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -639,8 +623,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -656,7 +638,7 @@ async def delete( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -678,8 +660,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -704,7 +684,7 @@ async def edit( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, activated: bool | Omit = omit, interrupt_window_days_of_week: List[ Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] @@ -743,8 +723,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -782,7 +760,7 @@ async def get( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -804,8 +782,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: diff --git a/src/cloudflare/resources/magic_transit/connectors/events/events.py b/src/cloudflare/resources/magic_transit/connectors/events/events.py index c177e559aec..21ee946d4c9 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/events.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/events.py @@ -61,7 +61,7 @@ def list( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, from_: float, to: float, cursor: str | Omit = omit, @@ -90,8 +90,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -126,7 +124,7 @@ def get( self, event_n: float, *, - account_id: str | None = None, + account_id: str, connector_id: str, event_t: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -150,8 +148,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -203,7 +199,7 @@ async def list( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, from_: float, to: float, cursor: str | Omit = omit, @@ -232,8 +228,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -268,7 +262,7 @@ async def get( self, event_n: float, *, - account_id: str | None = None, + account_id: str, connector_id: str, event_t: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -292,8 +286,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: diff --git a/src/cloudflare/resources/magic_transit/connectors/events/latest.py b/src/cloudflare/resources/magic_transit/connectors/events/latest.py index 2fa9e2caff1..44b0e8011d1 100644 --- a/src/cloudflare/resources/magic_transit/connectors/events/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/events/latest.py @@ -47,7 +47,7 @@ def list( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -116,7 +114,7 @@ async def list( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -138,8 +136,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py index 0bf0132b619..794573f48f3 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/latest.py @@ -47,7 +47,7 @@ def list( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -116,7 +114,7 @@ async def list( self, connector_id: str, *, - account_id: str | None = None, + account_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, @@ -138,8 +136,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: diff --git a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py index f54e7f372df..50f9746e5ca 100644 --- a/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py +++ b/src/cloudflare/resources/magic_transit/connectors/snapshots/snapshots.py @@ -61,7 +61,7 @@ def list( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, from_: float, to: float, cursor: str | Omit = omit, @@ -87,8 +87,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -122,7 +120,7 @@ def get( self, snapshot_t: float, *, - account_id: str | None = None, + account_id: str, connector_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. @@ -145,8 +143,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -197,7 +193,7 @@ async def list( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, from_: float, to: float, cursor: str | Omit = omit, @@ -223,8 +219,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: @@ -258,7 +252,7 @@ async def get( self, snapshot_t: float, *, - account_id: str | None = None, + account_id: str, connector_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. @@ -281,8 +275,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not connector_id: diff --git a/src/cloudflare/resources/magic_transit/gre_tunnels.py b/src/cloudflare/resources/magic_transit/gre_tunnels.py index 5fca90a33d7..e0cf9482bee 100644 --- a/src/cloudflare/resources/magic_transit/gre_tunnels.py +++ b/src/cloudflare/resources/magic_transit/gre_tunnels.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> GRETunnelsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, cloudflare_gre_endpoint: str, customer_gre_endpoint: str, interface_address: str, @@ -114,8 +114,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -160,7 +158,7 @@ def update( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, cloudflare_gre_endpoint: str, customer_gre_endpoint: str, interface_address: str, @@ -223,8 +221,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: @@ -273,7 +269,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -296,8 +292,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -326,7 +320,7 @@ def delete( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -353,8 +347,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: @@ -388,7 +380,7 @@ def delete( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -414,8 +406,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -445,7 +435,7 @@ def get( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -470,8 +460,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: @@ -526,7 +514,7 @@ def with_streaming_response(self) -> AsyncGRETunnelsResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, cloudflare_gre_endpoint: str, customer_gre_endpoint: str, interface_address: str, @@ -588,8 +576,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -634,7 +620,7 @@ async def update( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, cloudflare_gre_endpoint: str, customer_gre_endpoint: str, interface_address: str, @@ -697,8 +683,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: @@ -747,7 +731,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -770,8 +754,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -800,7 +782,7 @@ async def delete( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -827,8 +809,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: @@ -862,7 +842,7 @@ async def delete( async def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -888,8 +868,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -919,7 +897,7 @@ async def get( self, gre_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -944,8 +922,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not gre_tunnel_id: diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py index 69b3a382f8c..0e3f3ade8bc 100644 --- a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py +++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py @@ -58,7 +58,7 @@ def with_streaming_response(self) -> IPSECTunnelsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, cloudflare_endpoint: str, interface_address: str, name: str, @@ -122,8 +122,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -169,7 +167,7 @@ def update( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, cloudflare_endpoint: str, interface_address: str, name: str, @@ -235,8 +233,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -287,7 +283,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -310,8 +306,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -340,7 +334,7 @@ def delete( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -367,8 +361,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -402,7 +394,7 @@ def delete( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -429,8 +421,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -460,7 +450,7 @@ def get( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -485,8 +475,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -521,7 +509,7 @@ def psk_generate( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -550,8 +538,6 @@ def psk_generate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -597,7 +583,7 @@ def with_streaming_response(self) -> AsyncIPSECTunnelsResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, cloudflare_endpoint: str, interface_address: str, name: str, @@ -661,8 +647,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -708,7 +692,7 @@ async def update( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, cloudflare_endpoint: str, interface_address: str, name: str, @@ -774,8 +758,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -826,7 +808,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -849,8 +831,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -879,7 +859,7 @@ async def delete( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -906,8 +886,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -941,7 +919,7 @@ async def delete( async def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: object, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -968,8 +946,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -999,7 +975,7 @@ async def get( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1024,8 +1000,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: @@ -1060,7 +1034,7 @@ async def psk_generate( self, ipsec_tunnel_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1089,8 +1063,6 @@ async def psk_generate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ipsec_tunnel_id: diff --git a/src/cloudflare/resources/magic_transit/pcaps/download.py b/src/cloudflare/resources/magic_transit/pcaps/download.py index 5fe1df8c155..5bdd6de00fc 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/download.py +++ b/src/cloudflare/resources/magic_transit/pcaps/download.py @@ -47,7 +47,7 @@ def get( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: @@ -112,7 +110,7 @@ async def get( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -137,8 +135,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: diff --git a/src/cloudflare/resources/magic_transit/pcaps/ownership.py b/src/cloudflare/resources/magic_transit/pcaps/ownership.py index 7c705d53b6a..0d98d7249e4 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/ownership.py +++ b/src/cloudflare/resources/magic_transit/pcaps/ownership.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> OwnershipResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, destination_conf: 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. @@ -73,8 +73,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -94,7 +92,7 @@ def delete( self, ownership_id: str, *, - account_id: str | None = None, + account_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, @@ -118,8 +116,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ownership_id: @@ -140,7 +136,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -162,8 +158,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -178,7 +172,7 @@ def get( def validate( self, *, - account_id: str | None = None, + account_id: str, destination_conf: str, ownership_challenge: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -206,8 +200,6 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -253,7 +245,7 @@ def with_streaming_response(self) -> AsyncOwnershipResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_id: str, destination_conf: 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. @@ -278,8 +270,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -301,7 +291,7 @@ async def delete( self, ownership_id: str, *, - account_id: str | None = None, + account_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, @@ -325,8 +315,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ownership_id: @@ -347,7 +335,7 @@ async def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -369,8 +357,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -385,7 +371,7 @@ def get( async def validate( self, *, - account_id: str | None = None, + account_id: str, destination_conf: str, ownership_challenge: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -413,8 +399,6 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py index 2399e9b383b..aef16463545 100644 --- a/src/cloudflare/resources/magic_transit/pcaps/pcaps.py +++ b/src/cloudflare/resources/magic_transit/pcaps/pcaps.py @@ -78,7 +78,7 @@ def with_streaming_response(self) -> PCAPsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, packet_limit: float, system: Literal["magic-transit"], time_limit: float, @@ -126,7 +126,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, colo_name: str, destination_conf: str, system: Literal["magic-transit"], @@ -179,13 +179,13 @@ def create( ... @required_args( - ["packet_limit", "system", "time_limit", "type"], - ["colo_name", "destination_conf", "system", "time_limit", "type"], + ["account_id", "packet_limit", "system", "time_limit", "type"], + ["account_id", "colo_name", "destination_conf", "system", "time_limit", "type"], ) def create( self, *, - account_id: str | None = None, + account_id: str, packet_limit: float | Omit = omit, system: Literal["magic-transit"], time_limit: float, @@ -202,8 +202,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -240,7 +238,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -262,8 +260,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -279,7 +275,7 @@ def get( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -303,8 +299,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: @@ -330,7 +324,7 @@ def stop( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -354,8 +348,6 @@ def stop( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: @@ -402,7 +394,7 @@ def with_streaming_response(self) -> AsyncPCAPsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, packet_limit: float, system: Literal["magic-transit"], time_limit: float, @@ -450,7 +442,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, colo_name: str, destination_conf: str, system: Literal["magic-transit"], @@ -503,13 +495,13 @@ async def create( ... @required_args( - ["packet_limit", "system", "time_limit", "type"], - ["colo_name", "destination_conf", "system", "time_limit", "type"], + ["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 | None = None, + account_id: str, packet_limit: float | Omit = omit, system: Literal["magic-transit"], time_limit: float, @@ -526,8 +518,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PCAPCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -564,7 +554,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -586,8 +576,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -603,7 +591,7 @@ async def get( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -627,8 +615,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: @@ -654,7 +640,7 @@ async def stop( self, pcap_id: str, *, - account_id: str | None = None, + account_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, @@ -678,8 +664,6 @@ async def stop( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pcap_id: diff --git a/src/cloudflare/resources/magic_transit/routes.py b/src/cloudflare/resources/magic_transit/routes.py index c084ca2372a..4e50c006bcf 100644 --- a/src/cloudflare/resources/magic_transit/routes.py +++ b/src/cloudflare/resources/magic_transit/routes.py @@ -54,7 +54,7 @@ def with_streaming_response(self) -> RoutesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, nexthop: str, prefix: str, priority: int, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -127,7 +125,7 @@ def update( self, route_id: str, *, - account_id: str | None = None, + account_id: str, nexthop: str, prefix: str, priority: int, @@ -171,8 +169,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -203,7 +199,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -225,8 +221,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -245,7 +239,7 @@ def delete( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -269,8 +263,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -290,7 +282,7 @@ def delete( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, routes: Iterable[route_bulk_update_params.Route], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -316,8 +308,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -336,7 +326,7 @@ def bulk_update( def empty( self, *, - account_id: str | None = None, + account_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, @@ -358,8 +348,6 @@ def empty( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -378,7 +366,7 @@ def get( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -402,8 +390,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -444,7 +430,7 @@ def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, nexthop: str, prefix: str, priority: int, @@ -486,8 +472,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -517,7 +501,7 @@ async def update( self, route_id: str, *, - account_id: str | None = None, + account_id: str, nexthop: str, prefix: str, priority: int, @@ -561,8 +545,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -593,7 +575,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_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, @@ -615,8 +597,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -635,7 +615,7 @@ async def delete( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -659,8 +639,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -680,7 +658,7 @@ async def delete( async def bulk_update( self, *, - account_id: str | None = None, + account_id: str, routes: Iterable[route_bulk_update_params.Route], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -706,8 +684,6 @@ async def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -726,7 +702,7 @@ async def bulk_update( async def empty( self, *, - account_id: str | None = None, + account_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, @@ -748,8 +724,6 @@ async def empty( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -768,7 +742,7 @@ async def get( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -792,8 +766,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index 65c5b44d1ac..2906b7e128b 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -51,7 +51,7 @@ def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, lan_1: ACLConfigurationParam, lan_2: ACLConfigurationParam, name: str, @@ -95,8 +95,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -129,7 +127,7 @@ def update( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, description: str | Omit = omit, forward_locally: bool | Omit = omit, @@ -176,8 +174,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -217,7 +213,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -241,8 +237,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -260,7 +254,7 @@ def delete( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -287,8 +281,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -316,7 +308,7 @@ def edit( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, description: str | Omit = omit, forward_locally: bool | Omit = omit, @@ -363,8 +355,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -404,7 +394,7 @@ def get( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -431,8 +421,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -481,7 +469,7 @@ async def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, lan_1: ACLConfigurationParam, lan_2: ACLConfigurationParam, name: str, @@ -525,8 +513,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -559,7 +545,7 @@ async def update( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, description: str | Omit = omit, forward_locally: bool | Omit = omit, @@ -606,8 +592,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -647,7 +631,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -671,8 +655,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -690,7 +672,7 @@ async def delete( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -717,8 +699,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -746,7 +726,7 @@ async def edit( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, description: str | Omit = omit, forward_locally: bool | Omit = omit, @@ -793,8 +773,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -834,7 +812,7 @@ async def get( self, acl_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -861,8 +839,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: diff --git a/src/cloudflare/resources/magic_transit/sites/lans.py b/src/cloudflare/resources/magic_transit/sites/lans.py index abdf0f6d2b2..ca3771ff983 100644 --- a/src/cloudflare/resources/magic_transit/sites/lans.py +++ b/src/cloudflare/resources/magic_transit/sites/lans.py @@ -56,7 +56,7 @@ def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, bond_id: int | Omit = omit, ha_link: bool | Omit = omit, is_breakout: bool | Omit = omit, @@ -105,8 +105,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -140,7 +138,7 @@ def update( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, bond_id: int | Omit = omit, is_breakout: bool | Omit = omit, @@ -186,8 +184,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -229,7 +225,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +249,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -272,7 +266,7 @@ def delete( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -299,8 +293,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -328,7 +320,7 @@ def edit( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, bond_id: int | Omit = omit, is_breakout: bool | Omit = omit, @@ -374,8 +366,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -417,7 +407,7 @@ def get( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -444,8 +434,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -494,7 +482,7 @@ def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, bond_id: int | Omit = omit, ha_link: bool | Omit = omit, is_breakout: bool | Omit = omit, @@ -543,8 +531,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -578,7 +564,7 @@ async def update( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, bond_id: int | Omit = omit, is_breakout: bool | Omit = omit, @@ -624,8 +610,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -667,7 +651,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -691,8 +675,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -710,7 +692,7 @@ async def delete( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -737,8 +719,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -766,7 +746,7 @@ async def edit( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, bond_id: int | Omit = omit, is_breakout: bool | Omit = omit, @@ -812,8 +792,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -855,7 +833,7 @@ async def get( self, lan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -882,8 +860,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: diff --git a/src/cloudflare/resources/magic_transit/sites/sites.py b/src/cloudflare/resources/magic_transit/sites/sites.py index 6c1ddf1ce31..b09edd88dd1 100644 --- a/src/cloudflare/resources/magic_transit/sites/sites.py +++ b/src/cloudflare/resources/magic_transit/sites/sites.py @@ -90,7 +90,7 @@ def with_streaming_response(self) -> SitesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, connector_id: str | Omit = omit, description: str | Omit = omit, @@ -129,8 +129,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -160,7 +158,7 @@ def update( self, site_id: str, *, - account_id: str | None = None, + account_id: str, connector_id: str | Omit = omit, description: str | Omit = omit, location: SiteLocationParam | Omit = omit, @@ -197,8 +195,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -228,7 +224,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, connectorid: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -256,8 +252,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -277,7 +271,7 @@ def delete( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -301,8 +295,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -323,7 +315,7 @@ def edit( self, site_id: str, *, - account_id: str | None = None, + account_id: str, connector_id: str | Omit = omit, description: str | Omit = omit, location: SiteLocationParam | Omit = omit, @@ -360,8 +352,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -392,7 +382,7 @@ def get( self, site_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -417,8 +407,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -481,7 +469,7 @@ def with_streaming_response(self) -> AsyncSitesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, connector_id: str | Omit = omit, description: str | Omit = omit, @@ -520,8 +508,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -551,7 +537,7 @@ async def update( self, site_id: str, *, - account_id: str | None = None, + account_id: str, connector_id: str | Omit = omit, description: str | Omit = omit, location: SiteLocationParam | Omit = omit, @@ -588,8 +574,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -619,7 +603,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, connectorid: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -647,8 +631,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -668,7 +650,7 @@ async def delete( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -692,8 +674,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -714,7 +694,7 @@ async def edit( self, site_id: str, *, - account_id: str | None = None, + account_id: str, connector_id: str | Omit = omit, description: str | Omit = omit, location: SiteLocationParam | Omit = omit, @@ -751,8 +731,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -783,7 +761,7 @@ async def get( self, site_id: str, *, - account_id: str | None = None, + account_id: str, x_magic_new_hc_target: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -808,8 +786,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: diff --git a/src/cloudflare/resources/magic_transit/sites/wans.py b/src/cloudflare/resources/magic_transit/sites/wans.py index 44b24fb6c9c..94f31d081d3 100644 --- a/src/cloudflare/resources/magic_transit/sites/wans.py +++ b/src/cloudflare/resources/magic_transit/sites/wans.py @@ -50,7 +50,7 @@ def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, physport: int, name: str | Omit = omit, priority: int | Omit = omit, @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -114,7 +112,7 @@ def update( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, name: str | Omit = omit, physport: int | Omit = omit, @@ -151,8 +149,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -190,7 +186,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -214,8 +210,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -233,7 +227,7 @@ def delete( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -260,8 +254,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -289,7 +281,7 @@ def edit( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, name: str | Omit = omit, physport: int | Omit = omit, @@ -326,8 +318,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -365,7 +355,7 @@ def get( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -392,8 +382,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -442,7 +430,7 @@ def create( self, site_id: str, *, - account_id: str | None = None, + account_id: str, physport: int, name: str | Omit = omit, priority: int | Omit = omit, @@ -476,8 +464,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -506,7 +492,7 @@ async def update( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, name: str | Omit = omit, physport: int | Omit = omit, @@ -543,8 +529,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -582,7 +566,7 @@ def list( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -606,8 +590,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -625,7 +607,7 @@ async def delete( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -652,8 +634,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -681,7 +661,7 @@ async def edit( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_id: str, name: str | Omit = omit, physport: int | Omit = omit, @@ -718,8 +698,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -757,7 +735,7 @@ async def get( self, wan_id: str, *, - account_id: str | None = None, + account_id: str, site_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. @@ -784,8 +762,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: diff --git a/src/cloudflare/resources/managed_transforms.py b/src/cloudflare/resources/managed_transforms.py deleted file mode 100644 index 1b70c745c06..00000000000 --- a/src/cloudflare/resources/managed_transforms.py +++ /dev/null @@ -1,381 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Iterable, cast - -import httpx - -from .._types import Body, Query, Headers, NoneType, NotGiven, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.managed_transforms import managed_transform_edit_params -from ..types.managed_transforms.managed_transform_edit_response import ManagedTransformEditResponse -from ..types.managed_transforms.managed_transform_list_response import ManagedTransformListResponse - -__all__ = ["ManagedTransformsResource", "AsyncManagedTransformsResource"] - - -class ManagedTransformsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ManagedTransformsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ManagedTransformsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ManagedTransformsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ManagedTransformsResourceWithStreamingResponse(self) - - def list( - 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, - ) -> ManagedTransformListResponse: - """ - Fetches a list of all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), - ) - - def delete( - 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, - ) -> None: - """ - Disables all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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": "*/*", **(extra_headers or {})} - return self._delete( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - def edit( - self, - *, - zone_id: str, - managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], - managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ManagedTransformEditResponse: - """ - Updates the status of one or more Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - managed_request_headers: The list of Managed Request Transforms. - - managed_response_headers: The list of Managed Response Transforms. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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._patch( - f"/zones/{zone_id}/managed_headers", - body=maybe_transform( - { - "managed_request_headers": managed_request_headers, - "managed_response_headers": managed_response_headers, - }, - managed_transform_edit_params.ManagedTransformEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), - ) - - -class AsyncManagedTransformsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncManagedTransformsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncManagedTransformsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncManagedTransformsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncManagedTransformsResourceWithStreamingResponse(self) - - async def list( - 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, - ) -> ManagedTransformListResponse: - """ - Fetches a list of all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._get( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformListResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformListResponse], ResultWrapper[ManagedTransformListResponse]), - ) - - async def delete( - 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, - ) -> None: - """ - Disables all Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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": "*/*", **(extra_headers or {})} - return await self._delete( - f"/zones/{zone_id}/managed_headers", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - async def edit( - self, - *, - zone_id: str, - managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], - managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ManagedTransformEditResponse: - """ - Updates the status of one or more Managed Transforms. - - Args: - zone_id: The unique ID of the zone. - - managed_request_headers: The list of Managed Request Transforms. - - managed_response_headers: The list of Managed Response Transforms. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._patch( - f"/zones/{zone_id}/managed_headers", - body=await async_maybe_transform( - { - "managed_request_headers": managed_request_headers, - "managed_response_headers": managed_response_headers, - }, - managed_transform_edit_params.ManagedTransformEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ManagedTransformEditResponse]._unwrapper, - ), - cast_to=cast(Type[ManagedTransformEditResponse], ResultWrapper[ManagedTransformEditResponse]), - ) - - -class ManagedTransformsResourceWithRawResponse: - def __init__(self, managed_transforms: ManagedTransformsResource) -> None: - self._managed_transforms = managed_transforms - - self.list = to_raw_response_wrapper( - managed_transforms.list, - ) - self.delete = to_raw_response_wrapper( - managed_transforms.delete, - ) - self.edit = to_raw_response_wrapper( - managed_transforms.edit, - ) - - -class AsyncManagedTransformsResourceWithRawResponse: - def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: - self._managed_transforms = managed_transforms - - self.list = async_to_raw_response_wrapper( - managed_transforms.list, - ) - self.delete = async_to_raw_response_wrapper( - managed_transforms.delete, - ) - self.edit = async_to_raw_response_wrapper( - managed_transforms.edit, - ) - - -class ManagedTransformsResourceWithStreamingResponse: - def __init__(self, managed_transforms: ManagedTransformsResource) -> None: - self._managed_transforms = managed_transforms - - self.list = to_streamed_response_wrapper( - managed_transforms.list, - ) - self.delete = to_streamed_response_wrapper( - managed_transforms.delete, - ) - self.edit = to_streamed_response_wrapper( - managed_transforms.edit, - ) - - -class AsyncManagedTransformsResourceWithStreamingResponse: - def __init__(self, managed_transforms: AsyncManagedTransformsResource) -> None: - self._managed_transforms = managed_transforms - - self.list = async_to_streamed_response_wrapper( - managed_transforms.list, - ) - self.delete = async_to_streamed_response_wrapper( - managed_transforms.delete, - ) - self.edit = async_to_streamed_response_wrapper( - managed_transforms.edit, - ) diff --git a/src/cloudflare/resources/managed_transforms/managed_transforms.py b/src/cloudflare/resources/managed_transforms/managed_transforms.py index 35e19541e0c..cb1fd1cd1b8 100644 --- a/src/cloudflare/resources/managed_transforms/managed_transforms.py +++ b/src/cloudflare/resources/managed_transforms/managed_transforms.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ManagedTransformsResourceWithStreamingRespo def list( self, *, - zone_id: str | None = None, + 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, @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -89,7 +87,7 @@ def list( def delete( self, *, - zone_id: str | None = None, + 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, @@ -111,8 +109,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -127,7 +123,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -155,8 +151,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -202,7 +196,7 @@ def with_streaming_response(self) -> AsyncManagedTransformsResourceWithStreaming async def list( self, *, - zone_id: str | None = None, + 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, @@ -224,8 +218,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( @@ -243,7 +235,7 @@ async def list( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -265,8 +257,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -281,7 +271,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, managed_request_headers: Iterable[managed_transform_edit_params.ManagedRequestHeader], managed_response_headers: Iterable[managed_transform_edit_params.ManagedResponseHeader], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -309,8 +299,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( diff --git a/src/cloudflare/resources/memberships.py b/src/cloudflare/resources/memberships.py deleted file mode 100644 index 1bc6e6ba7b3..00000000000 --- a/src/cloudflare/resources/memberships.py +++ /dev/null @@ -1,515 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.memberships import membership_list_params, membership_update_params -from ..types.memberships.membership import Membership -from ..types.memberships.membership_get_response import MembershipGetResponse -from ..types.memberships.membership_delete_response import MembershipDeleteResponse -from ..types.memberships.membership_update_response import MembershipUpdateResponse - -__all__ = ["MembershipsResource", "AsyncMembershipsResource"] - - -class MembershipsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> MembershipsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return MembershipsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> MembershipsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return MembershipsResourceWithStreamingResponse(self) - - def update( - self, - membership_id: str, - *, - status: Literal["accepted", "rejected"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[MembershipUpdateResponse]: - """ - Accept or reject this account invitation. - - Args: - membership_id: Membership identifier tag. - - status: Whether to accept or reject this account invitation. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return self._put( - f"/memberships/{membership_id}", - body=maybe_transform({"status": status}, membership_update_params.MembershipUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipUpdateResponse]], ResultWrapper[MembershipUpdateResponse]), - ) - - def list( - self, - *, - account: membership_list_params.Account | Omit = omit, - direction: Literal["asc", "desc"] | Omit = omit, - name: str | Omit = omit, - order: Literal["id", "account.name", "status"] | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - status: Literal["accepted", "pending", "rejected"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[Membership]: - """ - List memberships of accounts the user can access. - - Args: - direction: Direction to order memberships. - - name: Account name - - order: Field to order memberships by. - - page: Page number of paginated results. - - per_page: Number of memberships per page. - - status: Status of this membership. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/memberships", - page=SyncV4PagePaginationArray[Membership], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account": account, - "direction": direction, - "name": name, - "order": order, - "page": page, - "per_page": per_page, - "status": status, - }, - membership_list_params.MembershipListParams, - ), - ), - model=Membership, - ) - - def delete( - self, - membership_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[MembershipDeleteResponse]: - """ - Remove the associated member from an account. - - Args: - membership_id: Membership identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return self._delete( - f"/memberships/{membership_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipDeleteResponse]], ResultWrapper[MembershipDeleteResponse]), - ) - - def get( - self, - membership_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[MembershipGetResponse]: - """ - Get a specific membership. - - Args: - membership_id: Membership identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return self._get( - f"/memberships/{membership_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipGetResponse]], ResultWrapper[MembershipGetResponse]), - ) - - -class AsyncMembershipsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncMembershipsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncMembershipsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncMembershipsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncMembershipsResourceWithStreamingResponse(self) - - async def update( - self, - membership_id: str, - *, - status: Literal["accepted", "rejected"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[MembershipUpdateResponse]: - """ - Accept or reject this account invitation. - - Args: - membership_id: Membership identifier tag. - - status: Whether to accept or reject this account invitation. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return await self._put( - f"/memberships/{membership_id}", - body=await async_maybe_transform({"status": status}, membership_update_params.MembershipUpdateParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipUpdateResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipUpdateResponse]], ResultWrapper[MembershipUpdateResponse]), - ) - - def list( - self, - *, - account: membership_list_params.Account | Omit = omit, - direction: Literal["asc", "desc"] | Omit = omit, - name: str | Omit = omit, - order: Literal["id", "account.name", "status"] | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - status: Literal["accepted", "pending", "rejected"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[Membership, AsyncV4PagePaginationArray[Membership]]: - """ - List memberships of accounts the user can access. - - Args: - direction: Direction to order memberships. - - name: Account name - - order: Field to order memberships by. - - page: Page number of paginated results. - - per_page: Number of memberships per page. - - status: Status of this membership. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/memberships", - page=AsyncV4PagePaginationArray[Membership], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "account": account, - "direction": direction, - "name": name, - "order": order, - "page": page, - "per_page": per_page, - "status": status, - }, - membership_list_params.MembershipListParams, - ), - ), - model=Membership, - ) - - async def delete( - self, - membership_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[MembershipDeleteResponse]: - """ - Remove the associated member from an account. - - Args: - membership_id: Membership identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return await self._delete( - f"/memberships/{membership_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipDeleteResponse]], ResultWrapper[MembershipDeleteResponse]), - ) - - async def get( - self, - membership_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[MembershipGetResponse]: - """ - Get a specific membership. - - Args: - membership_id: Membership identifier tag. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 membership_id: - raise ValueError(f"Expected a non-empty value for `membership_id` but received {membership_id!r}") - return await self._get( - f"/memberships/{membership_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[MembershipGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[MembershipGetResponse]], ResultWrapper[MembershipGetResponse]), - ) - - -class MembershipsResourceWithRawResponse: - def __init__(self, memberships: MembershipsResource) -> None: - self._memberships = memberships - - self.update = to_raw_response_wrapper( - memberships.update, - ) - self.list = to_raw_response_wrapper( - memberships.list, - ) - self.delete = to_raw_response_wrapper( - memberships.delete, - ) - self.get = to_raw_response_wrapper( - memberships.get, - ) - - -class AsyncMembershipsResourceWithRawResponse: - def __init__(self, memberships: AsyncMembershipsResource) -> None: - self._memberships = memberships - - self.update = async_to_raw_response_wrapper( - memberships.update, - ) - self.list = async_to_raw_response_wrapper( - memberships.list, - ) - self.delete = async_to_raw_response_wrapper( - memberships.delete, - ) - self.get = async_to_raw_response_wrapper( - memberships.get, - ) - - -class MembershipsResourceWithStreamingResponse: - def __init__(self, memberships: MembershipsResource) -> None: - self._memberships = memberships - - self.update = to_streamed_response_wrapper( - memberships.update, - ) - self.list = to_streamed_response_wrapper( - memberships.list, - ) - self.delete = to_streamed_response_wrapper( - memberships.delete, - ) - self.get = to_streamed_response_wrapper( - memberships.get, - ) - - -class AsyncMembershipsResourceWithStreamingResponse: - def __init__(self, memberships: AsyncMembershipsResource) -> None: - self._memberships = memberships - - self.update = async_to_streamed_response_wrapper( - memberships.update, - ) - self.list = async_to_streamed_response_wrapper( - memberships.list, - ) - self.delete = async_to_streamed_response_wrapper( - memberships.delete, - ) - self.get = async_to_streamed_response_wrapper( - memberships.get, - ) diff --git a/src/cloudflare/resources/mtls_certificates/associations.py b/src/cloudflare/resources/mtls_certificates/associations.py index 15930bbf7ad..837a02f3983 100644 --- a/src/cloudflare/resources/mtls_certificates/associations.py +++ b/src/cloudflare/resources/mtls_certificates/associations.py @@ -45,7 +45,7 @@ def get( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: @@ -115,7 +113,7 @@ def get( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -139,8 +137,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index 05de8a723c1..04a3223a38b 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> MTLSCertificatesResourceWithStreamingRespon def create( self, *, - account_id: str | None = None, + account_id: str, ca: bool, certificates: str, name: str | Omit = omit, @@ -100,8 +100,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -128,7 +126,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, type: List[Literal["custom", "gateway_managed", "access_managed"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -156,8 +154,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -177,7 +173,7 @@ def delete( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -202,8 +198,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: @@ -230,7 +224,7 @@ def get( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -257,8 +251,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: @@ -309,7 +301,7 @@ def with_streaming_response(self) -> AsyncMTLSCertificatesResourceWithStreamingR async def create( self, *, - account_id: str | None = None, + account_id: str, ca: bool, certificates: str, name: str | Omit = omit, @@ -347,8 +339,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -375,7 +365,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, type: List[Literal["custom", "gateway_managed", "access_managed"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -403,8 +393,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -424,7 +412,7 @@ async def delete( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -449,8 +437,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: @@ -477,7 +463,7 @@ async def get( self, mtls_certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -504,8 +490,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not mtls_certificate_id: diff --git a/src/cloudflare/resources/network_interconnects/cnis.py b/src/cloudflare/resources/network_interconnects/cnis.py index 33087d76580..b16c15a0d8f 100644 --- a/src/cloudflare/resources/network_interconnects/cnis.py +++ b/src/cloudflare/resources/network_interconnects/cnis.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> CNIsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, account: str, interconnect: str, magic: cni_create_params.Magic, @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -102,7 +100,7 @@ def update( self, cni: str, *, - account_id: str | None = None, + account_id: str, id: str, account: str, cust_ip: str, @@ -141,8 +139,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: @@ -170,7 +166,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, slot: Optional[str] | Omit = omit, @@ -200,8 +196,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -228,7 +222,7 @@ def delete( self, cni: str, *, - account_id: str | None = None, + account_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, @@ -250,8 +244,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: @@ -269,7 +261,7 @@ def get( self, cni: str, *, - account_id: str | None = None, + account_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, @@ -291,8 +283,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: @@ -329,7 +319,7 @@ def with_streaming_response(self) -> AsyncCNIsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, account: str, interconnect: str, magic: cni_create_params.Magic, @@ -357,8 +347,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -382,7 +370,7 @@ async def update( self, cni: str, *, - account_id: str | None = None, + account_id: str, id: str, account: str, cust_ip: str, @@ -421,8 +409,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: @@ -450,7 +436,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_id: str, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, slot: Optional[str] | Omit = omit, @@ -480,8 +466,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -508,7 +492,7 @@ async def delete( self, cni: str, *, - account_id: str | None = None, + account_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, @@ -530,8 +514,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: @@ -549,7 +531,7 @@ async def get( self, cni: str, *, - account_id: str | None = None, + account_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, @@ -571,8 +553,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not cni: diff --git a/src/cloudflare/resources/network_interconnects/interconnects.py b/src/cloudflare/resources/network_interconnects/interconnects.py index ac00201e599..932202086d2 100644 --- a/src/cloudflare/resources/network_interconnects/interconnects.py +++ b/src/cloudflare/resources/network_interconnects/interconnects.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> InterconnectsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, account: str, slot_id: str, type: str, @@ -83,7 +83,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, account: str, bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"], pairing_key: str, @@ -115,11 +115,13 @@ def create( """ ... - @required_args(["account", "slot_id", "type"], ["account", "bandwidth", "pairing_key", "type"]) + @required_args( + ["account_id", "account", "slot_id", "type"], ["account_id", "account", "bandwidth", "pairing_key", "type"] + ) def create( self, *, - account_id: str | None = None, + account_id: str, account: str, slot_id: str | Omit = omit, type: str, @@ -134,8 +136,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -165,7 +165,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, site: Optional[str] | Omit = omit, @@ -195,8 +195,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -223,7 +221,7 @@ def delete( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -245,8 +243,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -264,7 +260,7 @@ def get( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -286,8 +282,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -309,7 +303,7 @@ def loa( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -331,8 +325,6 @@ def loa( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -350,7 +342,7 @@ def status( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -372,8 +364,6 @@ def status( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -418,7 +408,7 @@ def with_streaming_response(self) -> AsyncInterconnectsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, account: str, slot_id: str, type: str, @@ -450,7 +440,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, account: str, bandwidth: Literal["50M", "100M", "200M", "300M", "400M", "500M", "1G", "2G", "5G", "10G", "20G", "50G"], pairing_key: str, @@ -482,11 +472,13 @@ async def create( """ ... - @required_args(["account", "slot_id", "type"], ["account", "bandwidth", "pairing_key", "type"]) + @required_args( + ["account_id", "account", "slot_id", "type"], ["account_id", "account", "bandwidth", "pairing_key", "type"] + ) async def create( self, *, - account_id: str | None = None, + account_id: str, account: str, slot_id: str | Omit = omit, type: str, @@ -501,8 +493,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InterconnectCreateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -532,7 +522,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_id: str, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, site: Optional[str] | Omit = omit, @@ -562,8 +552,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -590,7 +578,7 @@ async def delete( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -612,8 +600,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -631,7 +617,7 @@ async def get( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -653,8 +639,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -676,7 +660,7 @@ async def loa( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -698,8 +682,6 @@ async def loa( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: @@ -717,7 +699,7 @@ async def status( self, icon: str, *, - account_id: str | None = None, + account_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, @@ -739,8 +721,6 @@ async def status( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not icon: diff --git a/src/cloudflare/resources/network_interconnects/settings.py b/src/cloudflare/resources/network_interconnects/settings.py index 364783f417f..8535f11ec96 100644 --- a/src/cloudflare/resources/network_interconnects/settings.py +++ b/src/cloudflare/resources/network_interconnects/settings.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, default_asn: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,8 +68,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -84,7 +82,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -104,8 +102,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -140,7 +136,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, default_asn: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -161,8 +157,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -177,7 +171,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -197,8 +191,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/network_interconnects/slots.py b/src/cloudflare/resources/network_interconnects/slots.py index a3233a33b86..412bb34733b 100644 --- a/src/cloudflare/resources/network_interconnects/slots.py +++ b/src/cloudflare/resources/network_interconnects/slots.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SlotsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, address_contains: Optional[str] | Omit = omit, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, @@ -83,8 +83,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -113,7 +111,7 @@ def get( self, slot: str, *, - account_id: str | None = None, + account_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, @@ -135,8 +133,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not slot: @@ -173,7 +169,7 @@ def with_streaming_response(self) -> AsyncSlotsResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_id: str, address_contains: Optional[str] | Omit = omit, cursor: Optional[int] | Omit = omit, limit: Optional[int] | Omit = omit, @@ -209,8 +205,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -239,7 +233,7 @@ async def get( self, slot: str, *, - account_id: str | None = None, + account_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, @@ -261,8 +255,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not slot: diff --git a/src/cloudflare/resources/organizations/__init__.py b/src/cloudflare/resources/organizations/__init__.py index c87211e2b2c..f5b031a84f0 100644 --- a/src/cloudflare/resources/organizations/__init__.py +++ b/src/cloudflare/resources/organizations/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) from .organizations import ( OrganizationsResource, AsyncOrganizationsResource, @@ -24,6 +32,12 @@ "AsyncOrganizationProfileResourceWithRawResponse", "OrganizationProfileResourceWithStreamingResponse", "AsyncOrganizationProfileResourceWithStreamingResponse", + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", "OrganizationsResource", "AsyncOrganizationsResource", "OrganizationsResourceWithRawResponse", diff --git a/src/cloudflare/resources/organizations/api.md b/src/cloudflare/resources/organizations/api.md index 4addbb903b4..86142be6ffa 100644 --- a/src/cloudflare/resources/organizations/api.md +++ b/src/cloudflare/resources/organizations/api.md @@ -26,3 +26,17 @@ Methods: - client.organizations.organization_profile.update(organization_id, \*\*params) -> None - client.organizations.organization_profile.get(organization_id) -> Result + +## Logs + +### Audit + +Types: + +```python +from cloudflare.types.organizations.logs import AuditListResponse +``` + +Methods: + +- client.organizations.logs.audit.list(organization_id, \*\*params) -> SyncCursorPaginationAfter[AuditListResponse] diff --git a/src/cloudflare/resources/organizations/logs/__init__.py b/src/cloudflare/resources/organizations/logs/__init__.py new file mode 100644 index 00000000000..5d5ddcdb7e2 --- /dev/null +++ b/src/cloudflare/resources/organizations/logs/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from .audit import ( + AuditResource, + AsyncAuditResource, + AuditResourceWithRawResponse, + AsyncAuditResourceWithRawResponse, + AuditResourceWithStreamingResponse, + AsyncAuditResourceWithStreamingResponse, +) + +__all__ = [ + "AuditResource", + "AsyncAuditResource", + "AuditResourceWithRawResponse", + "AsyncAuditResourceWithRawResponse", + "AuditResourceWithStreamingResponse", + "AsyncAuditResourceWithStreamingResponse", + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/organizations/logs/audit.py b/src/cloudflare/resources/organizations/logs/audit.py new file mode 100644 index 00000000000..c7798a2f403 --- /dev/null +++ b/src/cloudflare/resources/organizations/logs/audit.py @@ -0,0 +1,320 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Literal + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import path_template, maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from ...._base_client import AsyncPaginator, make_request_options +from ....types.organizations.logs import audit_list_params +from ....types.organizations.logs.audit_list_response import AuditListResponse + +__all__ = ["AuditResource", "AsyncAuditResource"] + + +class AuditResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AuditResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AuditResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AuditResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AuditResourceWithStreamingResponse(self) + + def list( + self, + organization_id: str, + *, + before: Union[str, date], + since: Union[str, date], + id: audit_list_params.ID | Omit = omit, + action_result: audit_list_params.ActionResult | Omit = omit, + action_type: audit_list_params.ActionType | Omit = omit, + actor_context: audit_list_params.ActorContext | Omit = omit, + actor_email: audit_list_params.ActorEmail | Omit = omit, + actor_id: audit_list_params.ActorID | Omit = omit, + actor_ip_address: audit_list_params.ActorIPAddress | Omit = omit, + actor_token_id: audit_list_params.ActorTokenID | Omit = omit, + actor_token_name: audit_list_params.ActorTokenName | Omit = omit, + actor_type: audit_list_params.ActorType | Omit = omit, + cursor: str | Omit = omit, + direction: Literal["desc", "asc"] | Omit = omit, + limit: float | Omit = omit, + raw_cf_rayid: audit_list_params.RawCfRayID | Omit = omit, + raw_method: audit_list_params.RawMethod | Omit = omit, + raw_status_code: audit_list_params.RawStatusCode | Omit = omit, + raw_uri: audit_list_params.RawURI | Omit = omit, + resource_id: audit_list_params.ResourceID | Omit = omit, + resource_product: audit_list_params.ResourceProduct | Omit = omit, + resource_scope: audit_list_params.ResourceScope | Omit = omit, + resource_type: audit_list_params.ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncCursorPaginationAfter[AuditListResponse]: + """ + Gets a list of audit logs for an organization. + + Args: + organization_id: The unique id that identifies the organization. + + before: Limits the returned results to logs older than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. + + since: Limits the returned results to logs newer than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. + + cursor: The cursor is an opaque token used to paginate through large sets of records. It + indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + + direction: Sets sorting order. + + limit: The number limits the objects to return. The cursor attribute may be used to + iterate over the next batch of objects if there are more than the limit. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._get_api_list( + path_template("/organizations/{organization_id}/logs/audit", organization_id=organization_id), + page=SyncCursorPaginationAfter[AuditListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "before": before, + "since": since, + "id": id, + "action_result": action_result, + "action_type": action_type, + "actor_context": actor_context, + "actor_email": actor_email, + "actor_id": actor_id, + "actor_ip_address": actor_ip_address, + "actor_token_id": actor_token_id, + "actor_token_name": actor_token_name, + "actor_type": actor_type, + "cursor": cursor, + "direction": direction, + "limit": limit, + "raw_cf_rayid": raw_cf_rayid, + "raw_method": raw_method, + "raw_status_code": raw_status_code, + "raw_uri": raw_uri, + "resource_id": resource_id, + "resource_product": resource_product, + "resource_scope": resource_scope, + "resource_type": resource_type, + }, + audit_list_params.AuditListParams, + ), + ), + model=AuditListResponse, + ) + + +class AsyncAuditResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAuditResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAuditResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAuditResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAuditResourceWithStreamingResponse(self) + + def list( + self, + organization_id: str, + *, + before: Union[str, date], + since: Union[str, date], + id: audit_list_params.ID | Omit = omit, + action_result: audit_list_params.ActionResult | Omit = omit, + action_type: audit_list_params.ActionType | Omit = omit, + actor_context: audit_list_params.ActorContext | Omit = omit, + actor_email: audit_list_params.ActorEmail | Omit = omit, + actor_id: audit_list_params.ActorID | Omit = omit, + actor_ip_address: audit_list_params.ActorIPAddress | Omit = omit, + actor_token_id: audit_list_params.ActorTokenID | Omit = omit, + actor_token_name: audit_list_params.ActorTokenName | Omit = omit, + actor_type: audit_list_params.ActorType | Omit = omit, + cursor: str | Omit = omit, + direction: Literal["desc", "asc"] | Omit = omit, + limit: float | Omit = omit, + raw_cf_rayid: audit_list_params.RawCfRayID | Omit = omit, + raw_method: audit_list_params.RawMethod | Omit = omit, + raw_status_code: audit_list_params.RawStatusCode | Omit = omit, + raw_uri: audit_list_params.RawURI | Omit = omit, + resource_id: audit_list_params.ResourceID | Omit = omit, + resource_product: audit_list_params.ResourceProduct | Omit = omit, + resource_scope: audit_list_params.ResourceScope | Omit = omit, + resource_type: audit_list_params.ResourceType | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this 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[AuditListResponse, AsyncCursorPaginationAfter[AuditListResponse]]: + """ + Gets a list of audit logs for an organization. + + Args: + organization_id: The unique id that identifies the organization. + + before: Limits the returned results to logs older than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. + + since: Limits the returned results to logs newer than the specified date. This can be a + date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that + conforms to RFC3339. + + cursor: The cursor is an opaque token used to paginate through large sets of records. It + indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + + direction: Sets sorting order. + + limit: The number limits the objects to return. The cursor attribute may be used to + iterate over the next batch of objects if there are more than the limit. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters 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 organization_id: + raise ValueError(f"Expected a non-empty value for `organization_id` but received {organization_id!r}") + return self._get_api_list( + path_template("/organizations/{organization_id}/logs/audit", organization_id=organization_id), + page=AsyncCursorPaginationAfter[AuditListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "before": before, + "since": since, + "id": id, + "action_result": action_result, + "action_type": action_type, + "actor_context": actor_context, + "actor_email": actor_email, + "actor_id": actor_id, + "actor_ip_address": actor_ip_address, + "actor_token_id": actor_token_id, + "actor_token_name": actor_token_name, + "actor_type": actor_type, + "cursor": cursor, + "direction": direction, + "limit": limit, + "raw_cf_rayid": raw_cf_rayid, + "raw_method": raw_method, + "raw_status_code": raw_status_code, + "raw_uri": raw_uri, + "resource_id": resource_id, + "resource_product": resource_product, + "resource_scope": resource_scope, + "resource_type": resource_type, + }, + audit_list_params.AuditListParams, + ), + ), + model=AuditListResponse, + ) + + +class AuditResourceWithRawResponse: + def __init__(self, audit: AuditResource) -> None: + self._audit = audit + + self.list = to_raw_response_wrapper( + audit.list, + ) + + +class AsyncAuditResourceWithRawResponse: + def __init__(self, audit: AsyncAuditResource) -> None: + self._audit = audit + + self.list = async_to_raw_response_wrapper( + audit.list, + ) + + +class AuditResourceWithStreamingResponse: + def __init__(self, audit: AuditResource) -> None: + self._audit = audit + + self.list = to_streamed_response_wrapper( + audit.list, + ) + + +class AsyncAuditResourceWithStreamingResponse: + def __init__(self, audit: AsyncAuditResource) -> None: + self._audit = audit + + self.list = async_to_streamed_response_wrapper( + audit.list, + ) diff --git a/src/cloudflare/resources/organizations/logs/logs.py b/src/cloudflare/resources/organizations/logs/logs.py new file mode 100644 index 00000000000..69595caf7a3 --- /dev/null +++ b/src/cloudflare/resources/organizations/logs/logs.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .audit import ( + AuditResource, + AsyncAuditResource, + AuditResourceWithRawResponse, + AsyncAuditResourceWithRawResponse, + AuditResourceWithStreamingResponse, + AsyncAuditResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["LogsResource", "AsyncLogsResource"] + + +class LogsResource(SyncAPIResource): + @cached_property + def audit(self) -> AuditResource: + return AuditResource(self._client) + + @cached_property + def with_raw_response(self) -> LogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return LogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return LogsResourceWithStreamingResponse(self) + + +class AsyncLogsResource(AsyncAPIResource): + @cached_property + def audit(self) -> AsyncAuditResource: + return AsyncAuditResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncLogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncLogsResourceWithStreamingResponse(self) + + +class LogsResourceWithRawResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AuditResourceWithRawResponse: + return AuditResourceWithRawResponse(self._logs.audit) + + +class AsyncLogsResourceWithRawResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AsyncAuditResourceWithRawResponse: + return AsyncAuditResourceWithRawResponse(self._logs.audit) + + +class LogsResourceWithStreamingResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AuditResourceWithStreamingResponse: + return AuditResourceWithStreamingResponse(self._logs.audit) + + +class AsyncLogsResourceWithStreamingResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + @cached_property + def audit(self) -> AsyncAuditResourceWithStreamingResponse: + return AsyncAuditResourceWithStreamingResponse(self._logs.audit) diff --git a/src/cloudflare/resources/organizations/organization_profile.py b/src/cloudflare/resources/organizations/organization_profile.py index 5d11872fc2d..1bf721d9640 100644 --- a/src/cloudflare/resources/organizations/organization_profile.py +++ b/src/cloudflare/resources/organizations/organization_profile.py @@ -19,9 +19,7 @@ from ..._wrappers import ResultWrapper from ..._base_client import make_request_options from ...types.organizations import organization_profile_update_params -from ...types.organizations.organization_profile_get_params import ( # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] - Result, # pyright: ignore[reportUnknownVariableType] -) +from ...types.organizations.organization_profile_get_params import Result __all__ = ["OrganizationProfileResource", "AsyncOrganizationProfileResource"] @@ -97,7 +95,7 @@ def update( cast_to=NoneType, ) - def get( # pyright: ignore[reportUnknownParameterType] + def get( self, organization_id: str, *, @@ -131,9 +129,9 @@ def get( # pyright: ignore[reportUnknownParameterType] extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Result]._unwrapper, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + post_parser=ResultWrapper[Result]._unwrapper, ), - cast_to=cast(Type[Result], ResultWrapper[Result]), # pyright: ignore[reportUnknownArgumentType] + cast_to=cast(Type[Result], ResultWrapper[Result]), ) @@ -208,7 +206,7 @@ async def update( cast_to=NoneType, ) - async def get( # pyright: ignore[reportUnknownParameterType] + async def get( self, organization_id: str, *, @@ -242,9 +240,9 @@ async def get( # pyright: ignore[reportUnknownParameterType] extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Result]._unwrapper, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + post_parser=ResultWrapper[Result]._unwrapper, ), - cast_to=cast(Type[Result], ResultWrapper[Result]), # pyright: ignore[reportUnknownArgumentType] + cast_to=cast(Type[Result], ResultWrapper[Result]), ) @@ -256,7 +254,7 @@ def __init__(self, organization_profile: OrganizationProfileResource) -> None: organization_profile.update, ) self.get = to_raw_response_wrapper( - organization_profile.get, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + organization_profile.get, ) @@ -268,7 +266,7 @@ def __init__(self, organization_profile: AsyncOrganizationProfileResource) -> No organization_profile.update, ) self.get = async_to_raw_response_wrapper( - organization_profile.get, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + organization_profile.get, ) @@ -280,7 +278,7 @@ def __init__(self, organization_profile: OrganizationProfileResource) -> None: organization_profile.update, ) self.get = to_streamed_response_wrapper( - organization_profile.get, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + organization_profile.get, ) @@ -292,5 +290,5 @@ def __init__(self, organization_profile: AsyncOrganizationProfileResource) -> No organization_profile.update, ) self.get = async_to_streamed_response_wrapper( - organization_profile.get, # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + organization_profile.get, ) diff --git a/src/cloudflare/resources/organizations/organizations.py b/src/cloudflare/resources/organizations/organizations.py index cf097f97a1c..cf995f8d278 100644 --- a/src/cloudflare/resources/organizations/organizations.py +++ b/src/cloudflare/resources/organizations/organizations.py @@ -9,6 +9,14 @@ from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property +from .logs.logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -39,6 +47,10 @@ class OrganizationsResource(SyncAPIResource): def organization_profile(self) -> OrganizationProfileResource: return OrganizationProfileResource(self._client) + @cached_property + def logs(self) -> LogsResource: + return LogsResource(self._client) + @cached_property def with_raw_response(self) -> OrganizationsResourceWithRawResponse: """ @@ -304,6 +316,10 @@ class AsyncOrganizationsResource(AsyncAPIResource): def organization_profile(self) -> AsyncOrganizationProfileResource: return AsyncOrganizationProfileResource(self._client) + @cached_property + def logs(self) -> AsyncLogsResource: + return AsyncLogsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncOrganizationsResourceWithRawResponse: """ @@ -588,6 +604,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: def organization_profile(self) -> OrganizationProfileResourceWithRawResponse: return OrganizationProfileResourceWithRawResponse(self._organizations.organization_profile) + @cached_property + def logs(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self._organizations.logs) + class AsyncOrganizationsResourceWithRawResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: @@ -613,6 +633,10 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: def organization_profile(self) -> AsyncOrganizationProfileResourceWithRawResponse: return AsyncOrganizationProfileResourceWithRawResponse(self._organizations.organization_profile) + @cached_property + def logs(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self._organizations.logs) + class OrganizationsResourceWithStreamingResponse: def __init__(self, organizations: OrganizationsResource) -> None: @@ -638,6 +662,10 @@ def __init__(self, organizations: OrganizationsResource) -> None: def organization_profile(self) -> OrganizationProfileResourceWithStreamingResponse: return OrganizationProfileResourceWithStreamingResponse(self._organizations.organization_profile) + @cached_property + def logs(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self._organizations.logs) + class AsyncOrganizationsResourceWithStreamingResponse: def __init__(self, organizations: AsyncOrganizationsResource) -> None: @@ -662,3 +690,7 @@ def __init__(self, organizations: AsyncOrganizationsResource) -> None: @cached_property def organization_profile(self) -> AsyncOrganizationProfileResourceWithStreamingResponse: return AsyncOrganizationProfileResourceWithStreamingResponse(self._organizations.organization_profile) + + @cached_property + def logs(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self._organizations.logs) diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py deleted file mode 100644 index 1943091279a..00000000000 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ /dev/null @@ -1,569 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..types.ssl import RequestValidity -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.ssl.request_validity import RequestValidity -from ..types.origin_ca_certificates import origin_ca_certificate_list_params, origin_ca_certificate_create_params -from ..types.shared.certificate_request_type import CertificateRequestType -from ..types.origin_ca_certificates.origin_ca_certificate import OriginCACertificate -from ..types.origin_ca_certificates.origin_ca_certificate_delete_response import OriginCACertificateDeleteResponse - -__all__ = ["OriginCACertificatesResource", "AsyncOriginCACertificatesResource"] - - -class OriginCACertificatesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> OriginCACertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return OriginCACertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> OriginCACertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return OriginCACertificatesResourceWithStreamingResponse(self) - - def create( - self, - *, - csr: str, - hostnames: SequenceNotStr[str], - request_type: CertificateRequestType, - requested_validity: RequestValidity | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCACertificate]: - """Create an Origin CA certificate. - - You can use an Origin CA Key as your User - Service Key or an API token when calling this endpoint ([see above](#requests)). - - Args: - csr: The Certificate Signing Request (CSR). Must be newline-encoded. - - hostnames: Array of hostnames or wildcard names bound to the certificate. Hostnames must be - fully qualified domain names (FQDNs) belonging to zones on your account (e.g., - `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` - prefix for a single level (e.g., `*.example.com`). Double wildcards - (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not - allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is - valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically - converted to punycode. - - request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), - or "keyless-certificate" (for Keyless SSL servers). - - requested_validity: The number of days for which the certificate should be valid. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/certificates", - body=maybe_transform( - { - "csr": csr, - "hostnames": hostnames, - "request_type": request_type, - "requested_validity": requested_validity, - }, - origin_ca_certificate_create_params.OriginCACertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[OriginCACertificate]], ResultWrapper[OriginCACertificate]), - ) - - def list( - self, - *, - zone_id: str, - limit: int | Omit = omit, - offset: int | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCACertificate]: - """List all existing Origin CA certificates for a given zone. - - You can use an Origin - CA Key as your User Service Key or an API token when calling this endpoint - ([see above](#requests)). - - Args: - zone_id: Identifier. - - limit: Limit to the number of records returned. - - offset: Offset the results - - page: Page number of paginated results. - - per_page: Number of records per page. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/certificates", - page=SyncV4PagePaginationArray[OriginCACertificate], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "zone_id": zone_id, - "limit": limit, - "offset": offset, - "page": page, - "per_page": per_page, - }, - origin_ca_certificate_list_params.OriginCACertificateListParams, - ), - ), - model=OriginCACertificate, - ) - - def delete( - self, - certificate_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[OriginCACertificateDeleteResponse]: - """Revoke an existing Origin CA certificate by its serial number. - - You can use an - Origin CA Key as your User Service Key or an API token when calling this - endpoint ([see above](#requests)). - - Args: - certificate_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 certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return self._delete( - f"/certificates/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificateDeleteResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginCACertificateDeleteResponse]], ResultWrapper[OriginCACertificateDeleteResponse] - ), - ) - - def get( - self, - certificate_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[OriginCACertificate]: - """Get an existing Origin CA certificate by its serial number. - - You can use an - Origin CA Key as your User Service Key or an API token when calling this - endpoint ([see above](#requests)). - - Args: - certificate_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 certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return self._get( - f"/certificates/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[OriginCACertificate]], ResultWrapper[OriginCACertificate]), - ) - - -class AsyncOriginCACertificatesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncOriginCACertificatesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncOriginCACertificatesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncOriginCACertificatesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncOriginCACertificatesResourceWithStreamingResponse(self) - - async def create( - self, - *, - csr: str, - hostnames: SequenceNotStr[str], - request_type: CertificateRequestType, - requested_validity: RequestValidity | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCACertificate]: - """Create an Origin CA certificate. - - You can use an Origin CA Key as your User - Service Key or an API token when calling this endpoint ([see above](#requests)). - - Args: - csr: The Certificate Signing Request (CSR). Must be newline-encoded. - - hostnames: Array of hostnames or wildcard names bound to the certificate. Hostnames must be - fully qualified domain names (FQDNs) belonging to zones on your account (e.g., - `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` - prefix for a single level (e.g., `*.example.com`). Double wildcards - (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not - allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is - valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically - converted to punycode. - - request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), - or "keyless-certificate" (for Keyless SSL servers). - - requested_validity: The number of days for which the certificate should be valid. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/certificates", - body=await async_maybe_transform( - { - "csr": csr, - "hostnames": hostnames, - "request_type": request_type, - "requested_validity": requested_validity, - }, - origin_ca_certificate_create_params.OriginCACertificateCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[OriginCACertificate]], ResultWrapper[OriginCACertificate]), - ) - - def list( - self, - *, - zone_id: str, - limit: int | Omit = omit, - offset: int | Omit = omit, - page: float | Omit = omit, - per_page: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginCACertificate, AsyncV4PagePaginationArray[OriginCACertificate]]: - """List all existing Origin CA certificates for a given zone. - - You can use an Origin - CA Key as your User Service Key or an API token when calling this endpoint - ([see above](#requests)). - - Args: - zone_id: Identifier. - - limit: Limit to the number of records returned. - - offset: Offset the results - - page: Page number of paginated results. - - per_page: Number of records per page. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/certificates", - page=AsyncV4PagePaginationArray[OriginCACertificate], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "zone_id": zone_id, - "limit": limit, - "offset": offset, - "page": page, - "per_page": per_page, - }, - origin_ca_certificate_list_params.OriginCACertificateListParams, - ), - ), - model=OriginCACertificate, - ) - - async def delete( - self, - certificate_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[OriginCACertificateDeleteResponse]: - """Revoke an existing Origin CA certificate by its serial number. - - You can use an - Origin CA Key as your User Service Key or an API token when calling this - endpoint ([see above](#requests)). - - Args: - certificate_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 certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return await self._delete( - f"/certificates/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificateDeleteResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginCACertificateDeleteResponse]], ResultWrapper[OriginCACertificateDeleteResponse] - ), - ) - - async def get( - self, - certificate_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[OriginCACertificate]: - """Get an existing Origin CA certificate by its serial number. - - You can use an - Origin CA Key as your User Service Key or an API token when calling this - endpoint ([see above](#requests)). - - Args: - certificate_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 certificate_id: - raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - return await self._get( - f"/certificates/{certificate_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginCACertificate]]._unwrapper, - ), - cast_to=cast(Type[Optional[OriginCACertificate]], ResultWrapper[OriginCACertificate]), - ) - - -class OriginCACertificatesResourceWithRawResponse: - def __init__(self, origin_ca_certificates: OriginCACertificatesResource) -> None: - self._origin_ca_certificates = origin_ca_certificates - - self.create = to_raw_response_wrapper( - origin_ca_certificates.create, - ) - self.list = to_raw_response_wrapper( - origin_ca_certificates.list, - ) - self.delete = to_raw_response_wrapper( - origin_ca_certificates.delete, - ) - self.get = to_raw_response_wrapper( - origin_ca_certificates.get, - ) - - -class AsyncOriginCACertificatesResourceWithRawResponse: - def __init__(self, origin_ca_certificates: AsyncOriginCACertificatesResource) -> None: - self._origin_ca_certificates = origin_ca_certificates - - self.create = async_to_raw_response_wrapper( - origin_ca_certificates.create, - ) - self.list = async_to_raw_response_wrapper( - origin_ca_certificates.list, - ) - self.delete = async_to_raw_response_wrapper( - origin_ca_certificates.delete, - ) - self.get = async_to_raw_response_wrapper( - origin_ca_certificates.get, - ) - - -class OriginCACertificatesResourceWithStreamingResponse: - def __init__(self, origin_ca_certificates: OriginCACertificatesResource) -> None: - self._origin_ca_certificates = origin_ca_certificates - - self.create = to_streamed_response_wrapper( - origin_ca_certificates.create, - ) - self.list = to_streamed_response_wrapper( - origin_ca_certificates.list, - ) - self.delete = to_streamed_response_wrapper( - origin_ca_certificates.delete, - ) - self.get = to_streamed_response_wrapper( - origin_ca_certificates.get, - ) - - -class AsyncOriginCACertificatesResourceWithStreamingResponse: - def __init__(self, origin_ca_certificates: AsyncOriginCACertificatesResource) -> None: - self._origin_ca_certificates = origin_ca_certificates - - self.create = async_to_streamed_response_wrapper( - origin_ca_certificates.create, - ) - self.list = async_to_streamed_response_wrapper( - origin_ca_certificates.list, - ) - self.delete = async_to_streamed_response_wrapper( - origin_ca_certificates.delete, - ) - self.get = async_to_streamed_response_wrapper( - origin_ca_certificates.get, - ) diff --git a/src/cloudflare/resources/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption.py deleted file mode 100644 index d049002bc21..00000000000 --- a/src/cloudflare/resources/origin_post_quantum_encryption.py +++ /dev/null @@ -1,320 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Optional, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Query, Headers, NotGiven, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.origin_post_quantum_encryption import origin_post_quantum_encryption_update_params -from ..types.origin_post_quantum_encryption.origin_post_quantum_encryption_get_response import ( - OriginPostQuantumEncryptionGetResponse, -) -from ..types.origin_post_quantum_encryption.origin_post_quantum_encryption_update_response import ( - OriginPostQuantumEncryptionUpdateResponse, -) - -__all__ = ["OriginPostQuantumEncryptionResource", "AsyncOriginPostQuantumEncryptionResource"] - - -class OriginPostQuantumEncryptionResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> OriginPostQuantumEncryptionResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return OriginPostQuantumEncryptionResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> OriginPostQuantumEncryptionResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return OriginPostQuantumEncryptionResourceWithStreamingResponse(self) - - def update( - self, - *, - zone_id: str, - value: Literal["preferred", "supported", "off"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginPostQuantumEncryptionUpdateResponse]: - """ - Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when - connecting to your origin. Preferred instructs Cloudflare to opportunistically - send a Post-Quantum keyshare in the first message to the origin (for fastest - connections when the origin supports and prefers PQ), supported means that PQ - algorithms are advertised but only used when requested by the origin, and off - means that PQ algorithms are not advertised. - - Args: - zone_id: Identifier. - - value: Value of the Origin Post Quantum Encryption Setting. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], - ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], - ), - ) - - def get( - 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, - ) -> Optional[OriginPostQuantumEncryptionGetResponse]: - """ - Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when - connecting to your origin. Preferred instructs Cloudflare to opportunistically - send a Post-Quantum keyshare in the first message to the origin (for fastest - connections when the origin supports and prefers PQ), supported means that PQ - algorithms are advertised but only used when requested by the origin, and off - means that PQ algorithms are not advertised. - - 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._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionGetResponse]], - ResultWrapper[OriginPostQuantumEncryptionGetResponse], - ), - ) - - -class AsyncOriginPostQuantumEncryptionResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncOriginPostQuantumEncryptionResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncOriginPostQuantumEncryptionResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncOriginPostQuantumEncryptionResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncOriginPostQuantumEncryptionResourceWithStreamingResponse(self) - - async def update( - self, - *, - zone_id: str, - value: Literal["preferred", "supported", "off"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[OriginPostQuantumEncryptionUpdateResponse]: - """ - Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when - connecting to your origin. Preferred instructs Cloudflare to opportunistically - send a Post-Quantum keyshare in the first message to the origin (for fastest - connections when the origin supports and prefers PQ), supported means that PQ - algorithms are advertised but only used when requested by the origin, and off - means that PQ algorithms are not advertised. - - Args: - zone_id: Identifier. - - value: Value of the Origin Post Quantum Encryption Setting. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._put( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - body=await async_maybe_transform( - {"value": value}, origin_post_quantum_encryption_update_params.OriginPostQuantumEncryptionUpdateParams - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionUpdateResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionUpdateResponse]], - ResultWrapper[OriginPostQuantumEncryptionUpdateResponse], - ), - ) - - async def get( - 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, - ) -> Optional[OriginPostQuantumEncryptionGetResponse]: - """ - Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when - connecting to your origin. Preferred instructs Cloudflare to opportunistically - send a Post-Quantum keyshare in the first message to the origin (for fastest - connections when the origin supports and prefers PQ), supported means that PQ - algorithms are advertised but only used when requested by the origin, and off - means that PQ algorithms are not advertised. - - 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 await self._get( - f"/zones/{zone_id}/cache/origin_post_quantum_encryption", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[OriginPostQuantumEncryptionGetResponse]]._unwrapper, - ), - cast_to=cast( - Type[Optional[OriginPostQuantumEncryptionGetResponse]], - ResultWrapper[OriginPostQuantumEncryptionGetResponse], - ), - ) - - -class OriginPostQuantumEncryptionResourceWithRawResponse: - def __init__(self, origin_post_quantum_encryption: OriginPostQuantumEncryptionResource) -> None: - self._origin_post_quantum_encryption = origin_post_quantum_encryption - - self.update = to_raw_response_wrapper( - origin_post_quantum_encryption.update, - ) - self.get = to_raw_response_wrapper( - origin_post_quantum_encryption.get, - ) - - -class AsyncOriginPostQuantumEncryptionResourceWithRawResponse: - def __init__(self, origin_post_quantum_encryption: AsyncOriginPostQuantumEncryptionResource) -> None: - self._origin_post_quantum_encryption = origin_post_quantum_encryption - - self.update = async_to_raw_response_wrapper( - origin_post_quantum_encryption.update, - ) - self.get = async_to_raw_response_wrapper( - origin_post_quantum_encryption.get, - ) - - -class OriginPostQuantumEncryptionResourceWithStreamingResponse: - def __init__(self, origin_post_quantum_encryption: OriginPostQuantumEncryptionResource) -> None: - self._origin_post_quantum_encryption = origin_post_quantum_encryption - - self.update = to_streamed_response_wrapper( - origin_post_quantum_encryption.update, - ) - self.get = to_streamed_response_wrapper( - origin_post_quantum_encryption.get, - ) - - -class AsyncOriginPostQuantumEncryptionResourceWithStreamingResponse: - def __init__(self, origin_post_quantum_encryption: AsyncOriginPostQuantumEncryptionResource) -> None: - self._origin_post_quantum_encryption = origin_post_quantum_encryption - - self.update = async_to_streamed_response_wrapper( - origin_post_quantum_encryption.update, - ) - self.get = async_to_streamed_response_wrapper( - origin_post_quantum_encryption.get, - ) diff --git a/src/cloudflare/resources/origin_post_quantum_encryption/origin_post_quantum_encryption.py b/src/cloudflare/resources/origin_post_quantum_encryption/origin_post_quantum_encryption.py index e29afb53afe..f728f1884ff 100644 --- a/src/cloudflare/resources/origin_post_quantum_encryption/origin_post_quantum_encryption.py +++ b/src/cloudflare/resources/origin_post_quantum_encryption/origin_post_quantum_encryption.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> OriginPostQuantumEncryptionResourceWithStre def update( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["preferred", "supported", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -83,8 +83,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -108,7 +106,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -135,8 +133,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -178,7 +174,7 @@ def with_streaming_response(self) -> AsyncOriginPostQuantumEncryptionResourceWit async def update( self, *, - zone_id: str | None = None, + zone_id: str, value: Literal["preferred", "supported", "off"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -208,8 +204,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -233,7 +227,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -260,8 +254,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py index d1f633c90c2..a58779ba2c3 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> HostnameCertificatesResourceWithStreamingRe def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -81,8 +81,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -109,7 +107,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -132,8 +130,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -149,7 +145,7 @@ def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -177,8 +173,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -205,7 +199,7 @@ def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -229,8 +223,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -275,7 +267,7 @@ def with_streaming_response(self) -> AsyncHostnameCertificatesResourceWithStream async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -305,8 +297,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -333,7 +323,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -356,8 +346,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -373,7 +361,7 @@ async def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -401,8 +389,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -429,7 +415,7 @@ async def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -453,8 +439,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames.py index d4261249bfe..d2e3780d378 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> HostnamesResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, config: Iterable[hostname_update_params.Config], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -95,7 +93,7 @@ def get( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -121,8 +119,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: @@ -165,7 +161,7 @@ def with_streaming_response(self) -> AsyncHostnamesResourceWithStreamingResponse def update( self, *, - zone_id: str | None = None, + zone_id: str, config: Iterable[hostname_update_params.Config], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -192,8 +188,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -211,7 +205,7 @@ async def get( self, hostname: str, *, - zone_id: str | None = None, + 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, @@ -237,8 +231,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not hostname: diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index 84e85c097b6..e3e13762e8e 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -103,7 +103,7 @@ def with_streaming_response(self) -> OriginTLSClientAuthResourceWithStreamingRes def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -135,8 +135,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -166,7 +164,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -189,8 +187,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -209,7 +205,7 @@ def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -233,8 +229,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -264,7 +258,7 @@ def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -289,8 +283,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -354,7 +346,7 @@ def with_streaming_response(self) -> AsyncOriginTLSClientAuthResourceWithStreami async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -386,8 +378,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -417,7 +407,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -440,8 +430,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -460,7 +448,7 @@ async def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -484,8 +472,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -515,7 +501,7 @@ async def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -540,8 +526,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: diff --git a/src/cloudflare/resources/origin_tls_client_auth/settings.py b/src/cloudflare/resources/origin_tls_client_auth/settings.py index 24eed231e9d..6d34751b707 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/settings.py +++ b/src/cloudflare/resources/origin_tls_client_auth/settings.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -96,7 +94,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -120,8 +118,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -160,7 +156,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -188,8 +184,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -208,7 +202,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -232,8 +226,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py b/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py index ac9360a31ea..cf56bb3c34e 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> ZoneCertificatesResourceWithStreamingRespon def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -109,7 +107,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -132,8 +130,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -149,7 +145,7 @@ def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -173,8 +169,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -199,7 +193,7 @@ def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -224,8 +218,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -270,7 +262,7 @@ def with_streaming_response(self) -> AsyncZoneCertificatesResourceWithStreamingR async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate: str, private_key: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -302,8 +294,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -328,7 +318,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -351,8 +341,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -368,7 +356,7 @@ async def delete( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -392,8 +380,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: @@ -418,7 +404,7 @@ async def get( self, certificate_id: str, *, - zone_id: str | None = None, + 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, @@ -443,8 +429,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_id: diff --git a/src/cloudflare/resources/page_rules.py b/src/cloudflare/resources/page_rules.py deleted file mode 100644 index d687a14e8c0..00000000000 --- a/src/cloudflare/resources/page_rules.py +++ /dev/null @@ -1,883 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Iterable, Optional, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.page_rules import ( - page_rule_edit_params, - page_rule_list_params, - page_rule_create_params, - page_rule_update_params, -) -from ..types.page_rules.page_rule import PageRule -from ..types.page_rules.target_param import TargetParam -from ..types.page_rules.page_rule_list_response import PageRuleListResponse -from ..types.page_rules.page_rule_delete_response import PageRuleDeleteResponse - -__all__ = ["PageRulesResource", "AsyncPageRulesResource"] - - -class PageRulesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> PageRulesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return PageRulesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> PageRulesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return PageRulesResourceWithStreamingResponse(self) - - def create( - self, - *, - zone_id: str, - actions: Iterable[page_rule_create_params.Action], - targets: Iterable[TargetParam], - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """ - Creates a new Page Rule. - - Args: - zone_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - targets: The rule targets to evaluate on each request. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/pagerules", - body=maybe_transform( - { - "actions": actions, - "targets": targets, - "priority": priority, - "status": status, - }, - page_rule_create_params.PageRuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - def update( - self, - pagerule_id: str, - *, - zone_id: str, - actions: Iterable[page_rule_update_params.Action], - targets: Iterable[TargetParam], - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """Replaces the configuration of an existing Page Rule. - - The configuration of the - updated Page Rule will exactly match the data passed in the API request. - - Args: - zone_id: Identifier. - - pagerule_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - targets: The rule targets to evaluate on each request. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return self._put( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - body=maybe_transform( - { - "actions": actions, - "targets": targets, - "priority": priority, - "status": status, - }, - page_rule_update_params.PageRuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - def list( - self, - *, - zone_id: str, - direction: Literal["asc", "desc"] | Omit = omit, - match: Literal["any", "all"] | Omit = omit, - order: Literal["status", "priority"] | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRuleListResponse]: - """ - Fetches Page Rules in a zone. - - Args: - zone_id: Identifier. - - direction: The direction used to sort returned Page Rules. - - match: When set to `all`, all the search requirements must match. When set to `any`, - only one of the search requirements has to match. - - order: The field used to sort returned Page Rules. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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( - f"/zones/{zone_id}/pagerules", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "direction": direction, - "match": match, - "order": order, - "status": status, - }, - page_rule_list_params.PageRuleListParams, - ), - post_parser=ResultWrapper[Optional[PageRuleListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRuleListResponse]], ResultWrapper[PageRuleListResponse]), - ) - - def delete( - self, - pagerule_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[PageRuleDeleteResponse]: - """ - Deletes an existing Page Rule. - - Args: - zone_id: Identifier. - - pagerule_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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return self._delete( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRuleDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRuleDeleteResponse]], ResultWrapper[PageRuleDeleteResponse]), - ) - - def edit( - self, - pagerule_id: str, - *, - zone_id: str, - actions: Iterable[page_rule_edit_params.Action] | Omit = omit, - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - targets: Iterable[TargetParam] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """ - Updates one or more fields of an existing Page Rule. - - Args: - zone_id: Identifier. - - pagerule_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - targets: The rule targets to evaluate on each request. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return self._patch( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - body=maybe_transform( - { - "actions": actions, - "priority": priority, - "status": status, - "targets": targets, - }, - page_rule_edit_params.PageRuleEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - def get( - self, - pagerule_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[PageRule]: - """ - Fetches the details of a Page Rule. - - Args: - zone_id: Identifier. - - pagerule_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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return self._get( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - -class AsyncPageRulesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncPageRulesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncPageRulesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncPageRulesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncPageRulesResourceWithStreamingResponse(self) - - async def create( - self, - *, - zone_id: str, - actions: Iterable[page_rule_create_params.Action], - targets: Iterable[TargetParam], - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """ - Creates a new Page Rule. - - Args: - zone_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - targets: The rule targets to evaluate on each request. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._post( - f"/zones/{zone_id}/pagerules", - body=await async_maybe_transform( - { - "actions": actions, - "targets": targets, - "priority": priority, - "status": status, - }, - page_rule_create_params.PageRuleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - async def update( - self, - pagerule_id: str, - *, - zone_id: str, - actions: Iterable[page_rule_update_params.Action], - targets: Iterable[TargetParam], - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """Replaces the configuration of an existing Page Rule. - - The configuration of the - updated Page Rule will exactly match the data passed in the API request. - - Args: - zone_id: Identifier. - - pagerule_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - targets: The rule targets to evaluate on each request. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return await self._put( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - body=await async_maybe_transform( - { - "actions": actions, - "targets": targets, - "priority": priority, - "status": status, - }, - page_rule_update_params.PageRuleUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - async def list( - self, - *, - zone_id: str, - direction: Literal["asc", "desc"] | Omit = omit, - match: Literal["any", "all"] | Omit = omit, - order: Literal["status", "priority"] | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRuleListResponse]: - """ - Fetches Page Rules in a zone. - - Args: - zone_id: Identifier. - - direction: The direction used to sort returned Page Rules. - - match: When set to `all`, all the search requirements must match. When set to `any`, - only one of the search requirements has to match. - - order: The field used to sort returned Page Rules. - - status: The status of the Page Rule. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._get( - f"/zones/{zone_id}/pagerules", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "direction": direction, - "match": match, - "order": order, - "status": status, - }, - page_rule_list_params.PageRuleListParams, - ), - post_parser=ResultWrapper[Optional[PageRuleListResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRuleListResponse]], ResultWrapper[PageRuleListResponse]), - ) - - async def delete( - self, - pagerule_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[PageRuleDeleteResponse]: - """ - Deletes an existing Page Rule. - - Args: - zone_id: Identifier. - - pagerule_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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return await self._delete( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRuleDeleteResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRuleDeleteResponse]], ResultWrapper[PageRuleDeleteResponse]), - ) - - async def edit( - self, - pagerule_id: str, - *, - zone_id: str, - actions: Iterable[page_rule_edit_params.Action] | Omit = omit, - priority: int | Omit = omit, - status: Literal["active", "disabled"] | Omit = omit, - targets: Iterable[TargetParam] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[PageRule]: - """ - Updates one or more fields of an existing Page Rule. - - Args: - zone_id: Identifier. - - pagerule_id: Identifier. - - actions: The set of actions to perform if the targets of this rule match the request. - Actions can redirect to another URL or override settings, but not both. - - priority: The priority of the rule, used to define which Page Rule is processed over - another. A higher number indicates a higher priority. For example, if you have a - catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to - take precedence (rule B: `/images/special/*`), specify a higher priority for - rule B so it overrides rule A. - - status: The status of the Page Rule. - - targets: The rule targets to evaluate on each request. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return await self._patch( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - body=await async_maybe_transform( - { - "actions": actions, - "priority": priority, - "status": status, - "targets": targets, - }, - page_rule_edit_params.PageRuleEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - async def get( - self, - pagerule_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[PageRule]: - """ - Fetches the details of a Page Rule. - - Args: - zone_id: Identifier. - - pagerule_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 pagerule_id: - raise ValueError(f"Expected a non-empty value for `pagerule_id` but received {pagerule_id!r}") - return await self._get( - f"/zones/{zone_id}/pagerules/{pagerule_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[PageRule]]._unwrapper, - ), - cast_to=cast(Type[Optional[PageRule]], ResultWrapper[PageRule]), - ) - - -class PageRulesResourceWithRawResponse: - def __init__(self, page_rules: PageRulesResource) -> None: - self._page_rules = page_rules - - self.create = to_raw_response_wrapper( - page_rules.create, - ) - self.update = to_raw_response_wrapper( - page_rules.update, - ) - self.list = to_raw_response_wrapper( - page_rules.list, - ) - self.delete = to_raw_response_wrapper( - page_rules.delete, - ) - self.edit = to_raw_response_wrapper( - page_rules.edit, - ) - self.get = to_raw_response_wrapper( - page_rules.get, - ) - - -class AsyncPageRulesResourceWithRawResponse: - def __init__(self, page_rules: AsyncPageRulesResource) -> None: - self._page_rules = page_rules - - self.create = async_to_raw_response_wrapper( - page_rules.create, - ) - self.update = async_to_raw_response_wrapper( - page_rules.update, - ) - self.list = async_to_raw_response_wrapper( - page_rules.list, - ) - self.delete = async_to_raw_response_wrapper( - page_rules.delete, - ) - self.edit = async_to_raw_response_wrapper( - page_rules.edit, - ) - self.get = async_to_raw_response_wrapper( - page_rules.get, - ) - - -class PageRulesResourceWithStreamingResponse: - def __init__(self, page_rules: PageRulesResource) -> None: - self._page_rules = page_rules - - self.create = to_streamed_response_wrapper( - page_rules.create, - ) - self.update = to_streamed_response_wrapper( - page_rules.update, - ) - self.list = to_streamed_response_wrapper( - page_rules.list, - ) - self.delete = to_streamed_response_wrapper( - page_rules.delete, - ) - self.edit = to_streamed_response_wrapper( - page_rules.edit, - ) - self.get = to_streamed_response_wrapper( - page_rules.get, - ) - - -class AsyncPageRulesResourceWithStreamingResponse: - def __init__(self, page_rules: AsyncPageRulesResource) -> None: - self._page_rules = page_rules - - self.create = async_to_streamed_response_wrapper( - page_rules.create, - ) - self.update = async_to_streamed_response_wrapper( - page_rules.update, - ) - self.list = async_to_streamed_response_wrapper( - page_rules.list, - ) - self.delete = async_to_streamed_response_wrapper( - page_rules.delete, - ) - self.edit = async_to_streamed_response_wrapper( - page_rules.edit, - ) - self.get = async_to_streamed_response_wrapper( - page_rules.get, - ) diff --git a/src/cloudflare/resources/page_rules/page_rules.py b/src/cloudflare/resources/page_rules/page_rules.py index ac3ec8ba84c..411853417ae 100644 --- a/src/cloudflare/resources/page_rules/page_rules.py +++ b/src/cloudflare/resources/page_rules/page_rules.py @@ -56,7 +56,7 @@ def with_streaming_response(self) -> PageRulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_create_params.Action], targets: Iterable[TargetParam], priority: int | Omit = omit, @@ -95,8 +95,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -124,7 +122,7 @@ def update( self, pagerule_id: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_update_params.Action], targets: Iterable[TargetParam], priority: int | Omit = omit, @@ -167,8 +165,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -197,7 +193,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, order: Literal["status", "priority"] | Omit = omit, @@ -232,8 +228,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -261,7 +255,7 @@ def delete( self, pagerule_id: str, *, - zone_id: str | None = None, + 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, @@ -285,8 +279,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -307,7 +299,7 @@ def edit( self, pagerule_id: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_edit_params.Action] | Omit = omit, priority: int | Omit = omit, status: Literal["active", "disabled"] | Omit = omit, @@ -348,8 +340,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -379,7 +369,7 @@ def get( self, pagerule_id: str, *, - zone_id: str | None = None, + 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, @@ -403,8 +393,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -445,7 +433,7 @@ def with_streaming_response(self) -> AsyncPageRulesResourceWithStreamingResponse async def create( self, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_create_params.Action], targets: Iterable[TargetParam], priority: int | Omit = omit, @@ -484,8 +472,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -513,7 +499,7 @@ async def update( self, pagerule_id: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_update_params.Action], targets: Iterable[TargetParam], priority: int | Omit = omit, @@ -556,8 +542,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -586,7 +570,7 @@ async def update( async def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, match: Literal["any", "all"] | Omit = omit, order: Literal["status", "priority"] | Omit = omit, @@ -621,8 +605,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( @@ -650,7 +632,7 @@ async def delete( self, pagerule_id: str, *, - zone_id: str | None = None, + 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, @@ -674,8 +656,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -696,7 +676,7 @@ async def edit( self, pagerule_id: str, *, - zone_id: str | None = None, + zone_id: str, actions: Iterable[page_rule_edit_params.Action] | Omit = omit, priority: int | Omit = omit, status: Literal["active", "disabled"] | Omit = omit, @@ -737,8 +717,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: @@ -768,7 +746,7 @@ async def get( self, pagerule_id: str, *, - zone_id: str | None = None, + 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, @@ -792,8 +770,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not pagerule_id: diff --git a/src/cloudflare/resources/page_shield/connections.py b/src/cloudflare/resources/page_shield/connections.py index 39b35f56263..b215fac5845 100644 --- a/src/cloudflare/resources/page_shield/connections.py +++ b/src/cloudflare/resources/page_shield/connections.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> ConnectionsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, exclude_cdn_cgi: bool | Omit = omit, exclude_urls: str | Omit = omit, @@ -127,8 +127,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -164,7 +162,7 @@ def get( self, connection_id: str, *, - zone_id: str | None = None, + 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, @@ -188,8 +186,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not connection_id: @@ -232,7 +228,7 @@ def with_streaming_response(self) -> AsyncConnectionsResourceWithStreamingRespon def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, exclude_cdn_cgi: bool | Omit = omit, exclude_urls: str | Omit = omit, @@ -310,8 +306,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -347,7 +341,7 @@ async def get( self, connection_id: str, *, - zone_id: str | None = None, + 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, @@ -371,8 +365,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not connection_id: diff --git a/src/cloudflare/resources/page_shield/cookies.py b/src/cloudflare/resources/page_shield/cookies.py index 0c07ee9c55d..2f3f2b70c2d 100644 --- a/src/cloudflare/resources/page_shield/cookies.py +++ b/src/cloudflare/resources/page_shield/cookies.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> CookiesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, domain: str | Omit = omit, export: Literal["csv"] | Omit = omit, @@ -130,8 +130,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -169,7 +167,7 @@ def get( self, cookie_id: str, *, - zone_id: str | None = None, + 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, @@ -193,8 +191,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not cookie_id: @@ -235,7 +231,7 @@ def with_streaming_response(self) -> AsyncCookiesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, domain: str | Omit = omit, export: Literal["csv"] | Omit = omit, @@ -315,8 +311,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -354,7 +348,7 @@ async def get( self, cookie_id: str, *, - zone_id: str | None = None, + 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, @@ -378,8 +372,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not cookie_id: diff --git a/src/cloudflare/resources/page_shield/page_shield.py b/src/cloudflare/resources/page_shield/page_shield.py index 958bb7f0054..94a6d0e4f40 100644 --- a/src/cloudflare/resources/page_shield/page_shield.py +++ b/src/cloudflare/resources/page_shield/page_shield.py @@ -96,7 +96,7 @@ def with_streaming_response(self) -> PageShieldResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, use_cloudflare_reporting_endpoint: bool | Omit = omit, use_connection_url_path: bool | Omit = omit, @@ -128,8 +128,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -155,7 +153,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -177,8 +175,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -233,7 +229,7 @@ def with_streaming_response(self) -> AsyncPageShieldResourceWithStreamingRespons async def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, use_cloudflare_reporting_endpoint: bool | Omit = omit, use_connection_url_path: bool | Omit = omit, @@ -265,8 +261,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -292,7 +286,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -314,8 +308,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/page_shield/policies.py b/src/cloudflare/resources/page_shield/policies.py index 3fbf27ba258..8e1549d7235 100644 --- a/src/cloudflare/resources/page_shield/policies.py +++ b/src/cloudflare/resources/page_shield/policies.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, action: Literal["allow", "log", "add_reporting_directives"], description: str, enabled: bool, @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -120,7 +118,7 @@ def update( self, policy_id: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["allow", "log", "add_reporting_directives"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -160,8 +158,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: @@ -191,7 +187,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -213,8 +209,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -230,7 +224,7 @@ def delete( self, policy_id: str, *, - zone_id: str | None = None, + 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, @@ -254,8 +248,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: @@ -273,7 +265,7 @@ def get( self, policy_id: str, *, - zone_id: str | None = None, + 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, @@ -297,8 +289,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: @@ -339,7 +329,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, action: Literal["allow", "log", "add_reporting_directives"], description: str, enabled: bool, @@ -377,8 +367,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -407,7 +395,7 @@ async def update( self, policy_id: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["allow", "log", "add_reporting_directives"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -447,8 +435,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: @@ -478,7 +464,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -500,8 +486,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -517,7 +501,7 @@ async def delete( self, policy_id: str, *, - zone_id: str | None = None, + 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, @@ -541,8 +525,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: @@ -560,7 +542,7 @@ async def get( self, policy_id: str, *, - zone_id: str | None = None, + 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, @@ -584,8 +566,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/page_shield/scripts.py b/src/cloudflare/resources/page_shield/scripts.py index aabe35b99b7..b2cdf6ef07a 100644 --- a/src/cloudflare/resources/page_shield/scripts.py +++ b/src/cloudflare/resources/page_shield/scripts.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> ScriptsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, exclude_cdn_cgi: bool | Omit = omit, exclude_duplicates: bool | Omit = omit, @@ -133,8 +133,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -171,7 +169,7 @@ def get( self, script_id: str, *, - zone_id: str | None = None, + 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, @@ -195,8 +193,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not script_id: @@ -237,7 +233,7 @@ def with_streaming_response(self) -> AsyncScriptsResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, exclude_cdn_cgi: bool | Omit = omit, exclude_duplicates: bool | Omit = omit, @@ -320,8 +316,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -358,7 +352,7 @@ async def get( self, script_id: str, *, - zone_id: str | None = None, + 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, @@ -382,8 +376,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not script_id: diff --git a/src/cloudflare/resources/pages/projects/deployments/deployments.py b/src/cloudflare/resources/pages/projects/deployments/deployments.py index 307538717c8..11eef4a8ad8 100644 --- a/src/cloudflare/resources/pages/projects/deployments/deployments.py +++ b/src/cloudflare/resources/pages/projects/deployments/deployments.py @@ -62,7 +62,7 @@ def create( self, project_name: str, *, - account_id: str | None = None, + account_id: str, _headers: FileTypes | Omit = omit, _redirects: FileTypes | Omit = omit, _routes_json: FileTypes | Omit = omit, @@ -132,8 +132,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -192,7 +190,7 @@ def list( self, project_name: str, *, - account_id: str | None = None, + account_id: str, env: Literal["production", "preview"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -225,8 +223,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -259,7 +255,7 @@ def delete( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: str, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -290,8 +286,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -320,7 +314,7 @@ def get( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -347,8 +341,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -376,7 +368,7 @@ def retry( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -403,8 +395,6 @@ def retry( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -432,7 +422,7 @@ def rollback( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -461,8 +451,6 @@ def rollback( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -515,7 +503,7 @@ async def create( self, project_name: str, *, - account_id: str | None = None, + account_id: str, _headers: FileTypes | Omit = omit, _redirects: FileTypes | Omit = omit, _routes_json: FileTypes | Omit = omit, @@ -585,8 +573,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -645,7 +631,7 @@ def list( self, project_name: str, *, - account_id: str | None = None, + account_id: str, env: Literal["production", "preview"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -678,8 +664,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -712,7 +696,7 @@ async def delete( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: str, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -743,8 +727,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -773,7 +755,7 @@ async def get( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -800,8 +782,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -829,7 +809,7 @@ async def retry( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -856,8 +836,6 @@ async def retry( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -885,7 +863,7 @@ async def rollback( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -914,8 +892,6 @@ async def rollback( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: diff --git a/src/cloudflare/resources/pages/projects/deployments/history/logs.py b/src/cloudflare/resources/pages/projects/deployments/history/logs.py index 06c00834088..2c5321f72bb 100644 --- a/src/cloudflare/resources/pages/projects/deployments/history/logs.py +++ b/src/cloudflare/resources/pages/projects/deployments/history/logs.py @@ -47,7 +47,7 @@ def get( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -74,8 +74,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -124,7 +122,7 @@ async def get( self, deployment_id: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -151,8 +149,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: diff --git a/src/cloudflare/resources/pages/projects/domains.py b/src/cloudflare/resources/pages/projects/domains.py index 49e44c2c5f7..97bbe551c2d 100644 --- a/src/cloudflare/resources/pages/projects/domains.py +++ b/src/cloudflare/resources/pages/projects/domains.py @@ -52,7 +52,7 @@ def create( self, project_name: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -106,7 +104,7 @@ def list( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -153,7 +149,7 @@ def delete( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -180,8 +176,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -209,7 +203,7 @@ def edit( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -236,8 +230,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -265,7 +257,7 @@ def get( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -292,8 +284,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -342,7 +332,7 @@ async def create( self, project_name: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -369,8 +359,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -396,7 +384,7 @@ def list( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -420,8 +408,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -443,7 +429,7 @@ async def delete( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -470,8 +456,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -499,7 +483,7 @@ async def edit( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -526,8 +510,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -555,7 +537,7 @@ async def get( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, project_name: 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. @@ -582,8 +564,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: diff --git a/src/cloudflare/resources/pages/projects/projects.py b/src/cloudflare/resources/pages/projects/projects.py index cc25f2e0b38..94e70ddd47a 100644 --- a/src/cloudflare/resources/pages/projects/projects.py +++ b/src/cloudflare/resources/pages/projects/projects.py @@ -72,7 +72,7 @@ def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, production_branch: str, build_config: project_create_params.BuildConfig | Omit = omit, @@ -109,8 +109,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -138,7 +136,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -166,8 +164,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -193,7 +189,7 @@ def delete( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -217,8 +213,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -241,7 +235,7 @@ def edit( self, project_name: str, *, - account_id: str | None = None, + account_id: str, build_config: project_edit_params.BuildConfig | Omit = omit, deployment_configs: project_edit_params.DeploymentConfigs | Omit = omit, name: str | Omit = omit, @@ -282,8 +276,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -316,7 +308,7 @@ def get( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -340,8 +332,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -364,7 +354,7 @@ def purge_build_cache( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -388,8 +378,6 @@ def purge_build_cache( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -442,7 +430,7 @@ def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, production_branch: str, build_config: project_create_params.BuildConfig | Omit = omit, @@ -479,8 +467,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -508,7 +494,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -536,8 +522,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -563,7 +547,7 @@ async def delete( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -587,8 +571,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -611,7 +593,7 @@ async def edit( self, project_name: str, *, - account_id: str | None = None, + account_id: str, build_config: project_edit_params.BuildConfig | Omit = omit, deployment_configs: project_edit_params.DeploymentConfigs | Omit = omit, name: str | Omit = omit, @@ -652,8 +634,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -686,7 +666,7 @@ async def get( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -710,8 +690,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: @@ -734,7 +712,7 @@ async def purge_build_cache( self, project_name: str, *, - account_id: str | None = None, + account_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, @@ -758,8 +736,6 @@ async def purge_build_cache( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not project_name: diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 1e3f5a0d80c..883932bc36b 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -52,7 +52,7 @@ def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, script_name: str, type: Literal["worker"], dead_letter_queue: str | Omit = omit, @@ -89,7 +89,7 @@ def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, settings: consumer_create_params.MqHTTPConsumerRequestSettings | Omit = omit, @@ -118,12 +118,12 @@ def create( """ ... - @required_args(["script_name", "type"], ["type"]) + @required_args(["account_id", "script_name", "type"], ["account_id", "type"]) def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, script_name: str | Omit = omit, type: Literal["worker"] | Literal["http_pull"], dead_letter_queue: str | Omit = omit, @@ -137,8 +137,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -176,7 +174,7 @@ def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, script_name: str, type: Literal["worker"], @@ -216,7 +214,7 @@ def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, @@ -248,12 +246,12 @@ def update( """ ... - @required_args(["queue_id", "script_name", "type"], ["queue_id", "type"]) + @required_args(["account_id", "queue_id", "script_name", "type"], ["account_id", "queue_id", "type"]) def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, script_name: str | Omit = omit, type: Literal["worker"] | Literal["http_pull"], @@ -268,8 +266,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -311,7 +307,7 @@ def list( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -335,8 +331,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -356,7 +350,7 @@ def delete( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_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. @@ -383,8 +377,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -408,7 +400,7 @@ def get( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_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. @@ -435,8 +427,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -491,7 +481,7 @@ async def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, script_name: str, type: Literal["worker"], dead_letter_queue: str | Omit = omit, @@ -528,7 +518,7 @@ async def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, settings: consumer_create_params.MqHTTPConsumerRequestSettings | Omit = omit, @@ -557,12 +547,12 @@ async def create( """ ... - @required_args(["script_name", "type"], ["type"]) + @required_args(["account_id", "script_name", "type"], ["account_id", "type"]) async def create( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, script_name: str | Omit = omit, type: Literal["worker"] | Literal["http_pull"], dead_letter_queue: str | Omit = omit, @@ -576,8 +566,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -615,7 +603,7 @@ async def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, script_name: str, type: Literal["worker"], @@ -655,7 +643,7 @@ async def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, @@ -687,12 +675,12 @@ async def update( """ ... - @required_args(["queue_id", "script_name", "type"], ["queue_id", "type"]) + @required_args(["account_id", "queue_id", "script_name", "type"], ["account_id", "queue_id", "type"]) async def update( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_id: str, script_name: str | Omit = omit, type: Literal["worker"] | Literal["http_pull"], @@ -707,8 +695,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Consumer]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -750,7 +736,7 @@ def list( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -774,8 +760,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -795,7 +779,7 @@ async def delete( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_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. @@ -822,8 +806,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -847,7 +829,7 @@ async def get( self, consumer_id: str, *, - account_id: str | None = None, + account_id: str, queue_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. @@ -874,8 +856,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: diff --git a/src/cloudflare/resources/queues/messages.py b/src/cloudflare/resources/queues/messages.py index 69e9a3d1341..cd1bc973fc9 100644 --- a/src/cloudflare/resources/queues/messages.py +++ b/src/cloudflare/resources/queues/messages.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -52,7 +52,7 @@ def ack( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, acks: Iterable[message_ack_params.Ack] | Omit = omit, retries: Iterable[message_ack_params.Retry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -78,8 +78,6 @@ def ack( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -109,7 +107,7 @@ def bulk_push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, delay_seconds: float | Omit = omit, messages: Iterable[message_bulk_push_params.Message] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -137,8 +135,6 @@ def bulk_push( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -168,7 +164,7 @@ def pull( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, batch_size: float | Omit = omit, visibility_timeout_ms: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -199,8 +195,6 @@ def pull( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -231,7 +225,7 @@ def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: str | Omit = omit, content_type: Literal["text"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -268,7 +262,7 @@ def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: object | Omit = omit, content_type: Literal["json"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -300,11 +294,12 @@ def push( """ ... + @required_args(["account_id"]) def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: str | object | Omit = omit, content_type: Literal["text"] | Literal["json"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -315,8 +310,6 @@ def push( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessagePushResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -368,7 +361,7 @@ async def ack( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, acks: Iterable[message_ack_params.Ack] | Omit = omit, retries: Iterable[message_ack_params.Retry] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -394,8 +387,6 @@ async def ack( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -425,7 +416,7 @@ async def bulk_push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, delay_seconds: float | Omit = omit, messages: Iterable[message_bulk_push_params.Message] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -453,8 +444,6 @@ async def bulk_push( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -484,7 +473,7 @@ async def pull( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, batch_size: float | Omit = omit, visibility_timeout_ms: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -515,8 +504,6 @@ async def pull( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -547,7 +534,7 @@ async def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: str | Omit = omit, content_type: Literal["text"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -584,7 +571,7 @@ async def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: object | Omit = omit, content_type: Literal["json"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -616,11 +603,12 @@ async def push( """ ... + @required_args(["account_id"]) async def push( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, body: str | object | Omit = omit, content_type: Literal["text"] | Literal["json"] | Omit = omit, delay_seconds: float | Omit = omit, @@ -631,8 +619,6 @@ async def push( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MessagePushResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: diff --git a/src/cloudflare/resources/queues/purge.py b/src/cloudflare/resources/queues/purge.py index 8b35b693f4c..9df226d1cac 100644 --- a/src/cloudflare/resources/queues/purge.py +++ b/src/cloudflare/resources/queues/purge.py @@ -49,7 +49,7 @@ def start( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, delete_messages_permanently: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def start( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -101,7 +99,7 @@ def status( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def status( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -168,7 +164,7 @@ async def start( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, delete_messages_permanently: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -195,8 +191,6 @@ async def start( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -220,7 +214,7 @@ async def status( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -244,8 +238,6 @@ async def status( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: diff --git a/src/cloudflare/resources/queues/queues.py b/src/cloudflare/resources/queues/queues.py index 1595d106cb0..138d47827c4 100644 --- a/src/cloudflare/resources/queues/queues.py +++ b/src/cloudflare/resources/queues/queues.py @@ -97,7 +97,7 @@ def with_streaming_response(self) -> QueuesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, queue_name: 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. @@ -120,8 +120,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -141,7 +139,7 @@ def update( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, queue_name: str | Omit = omit, settings: queue_update_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -170,8 +168,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -198,7 +194,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -220,8 +216,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -237,7 +231,7 @@ def delete( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -261,8 +255,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -279,7 +271,7 @@ def edit( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, queue_name: str | Omit = omit, settings: queue_edit_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -305,8 +297,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -334,7 +324,7 @@ def get( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -358,8 +348,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -416,7 +404,7 @@ def with_streaming_response(self) -> AsyncQueuesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, queue_name: 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. @@ -439,8 +427,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -460,7 +446,7 @@ async def update( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, queue_name: str | Omit = omit, settings: queue_update_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -489,8 +475,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -517,7 +501,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -539,8 +523,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -556,7 +538,7 @@ async def delete( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -580,8 +562,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -598,7 +578,7 @@ async def edit( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, queue_name: str | Omit = omit, settings: queue_edit_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -624,8 +604,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -653,7 +631,7 @@ async def get( self, queue_id: str, *, - account_id: str | None = None, + account_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, @@ -677,8 +655,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: diff --git a/src/cloudflare/resources/queues/subscriptions.py b/src/cloudflare/resources/queues/subscriptions.py index 7f3ea3adda5..90e05aa3335 100644 --- a/src/cloudflare/resources/queues/subscriptions.py +++ b/src/cloudflare/resources/queues/subscriptions.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, destination: subscription_create_params.Destination | Omit = omit, enabled: bool | Omit = omit, events: SequenceNotStr[str] | Omit = omit, @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -120,7 +118,7 @@ def update( self, subscription_id: str, *, - account_id: str | None = None, + account_id: str, destination: subscription_update_params.Destination | Omit = omit, enabled: bool | Omit = omit, events: SequenceNotStr[str] | Omit = omit, @@ -156,8 +154,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: @@ -190,7 +186,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["created_at", "name", "enabled", "source"] | Omit = omit, page: int | Omit = omit, @@ -224,8 +220,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -253,7 +247,7 @@ def delete( self, subscription_id: str, *, - account_id: str | None = None, + account_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, @@ -277,8 +271,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: @@ -303,7 +295,7 @@ def get( self, subscription_id: str, *, - account_id: str | None = None, + account_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, @@ -327,8 +319,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: @@ -373,7 +363,7 @@ def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, destination: subscription_create_params.Destination | Omit = omit, enabled: bool | Omit = omit, events: SequenceNotStr[str] | Omit = omit, @@ -410,8 +400,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -440,7 +428,7 @@ async def update( self, subscription_id: str, *, - account_id: str | None = None, + account_id: str, destination: subscription_update_params.Destination | Omit = omit, enabled: bool | Omit = omit, events: SequenceNotStr[str] | Omit = omit, @@ -476,8 +464,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: @@ -510,7 +496,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["created_at", "name", "enabled", "source"] | Omit = omit, page: int | Omit = omit, @@ -544,8 +530,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -573,7 +557,7 @@ async def delete( self, subscription_id: str, *, - account_id: str | None = None, + account_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, @@ -597,8 +581,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: @@ -623,7 +605,7 @@ async def get( self, subscription_id: str, *, - account_id: str | None = None, + account_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, @@ -647,8 +629,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subscription_id: diff --git a/src/cloudflare/resources/r2/buckets/buckets.py b/src/cloudflare/resources/r2/buckets/buckets.py index e78b6c60a80..20c120caf46 100644 --- a/src/cloudflare/resources/r2/buckets/buckets.py +++ b/src/cloudflare/resources/r2/buckets/buckets.py @@ -133,7 +133,7 @@ def with_streaming_response(self) -> BucketsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | Omit = omit, storage_class: Literal["Standard", "InfrequentAccess"] | Omit = omit, @@ -167,8 +167,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -198,7 +196,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, name_contains: str | Omit = omit, @@ -243,8 +241,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -278,7 +274,7 @@ def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -305,8 +301,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -333,7 +327,7 @@ def edit( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, storage_class: Literal["Standard", "InfrequentAccess"], jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -363,8 +357,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -396,7 +388,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -423,8 +415,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -499,7 +489,7 @@ def with_streaming_response(self) -> AsyncBucketsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, location_hint: Literal["apac", "eeur", "enam", "weur", "wnam", "oc"] | Omit = omit, storage_class: Literal["Standard", "InfrequentAccess"] | Omit = omit, @@ -533,8 +523,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -564,7 +552,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, name_contains: str | Omit = omit, @@ -609,8 +597,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = { @@ -644,7 +630,7 @@ async def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -671,8 +657,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -699,7 +683,7 @@ async def edit( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, storage_class: Literal["Standard", "InfrequentAccess"], jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -729,8 +713,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -762,7 +744,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -789,8 +771,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/cors.py b/src/cloudflare/resources/r2/buckets/cors.py index 7c190781897..e8170289def 100644 --- a/src/cloudflare/resources/r2/buckets/cors.py +++ b/src/cloudflare/resources/r2/buckets/cors.py @@ -49,7 +49,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[cors_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -106,7 +104,7 @@ def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -133,8 +131,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -161,7 +157,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -188,8 +184,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -237,7 +231,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[cors_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -265,8 +259,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -294,7 +286,7 @@ async def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -321,8 +313,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -349,7 +339,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -376,8 +366,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/domains/custom.py b/src/cloudflare/resources/r2/buckets/domains/custom.py index 6b1bc2cd7e0..7d7fb8d6237 100644 --- a/src/cloudflare/resources/r2/buckets/domains/custom.py +++ b/src/cloudflare/resources/r2/buckets/domains/custom.py @@ -53,7 +53,7 @@ def create( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, domain: str, enabled: bool, zone_id: str, @@ -98,8 +98,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -138,7 +136,7 @@ def update( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, ciphers: SequenceNotStr[str] | Omit = omit, enabled: bool | Omit = omit, @@ -179,8 +177,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -220,7 +216,7 @@ def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -247,8 +243,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -277,7 +271,7 @@ def delete( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -307,8 +301,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -340,7 +332,7 @@ def get( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -370,8 +362,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -424,7 +414,7 @@ async def create( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, domain: str, enabled: bool, zone_id: str, @@ -469,8 +459,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -509,7 +497,7 @@ async def update( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, ciphers: SequenceNotStr[str] | Omit = omit, enabled: bool | Omit = omit, @@ -550,8 +538,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -591,7 +577,7 @@ async def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -618,8 +604,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -648,7 +632,7 @@ async def delete( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -678,8 +662,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -711,7 +693,7 @@ async def get( self, domain: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -741,8 +723,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/domains/managed.py b/src/cloudflare/resources/r2/buckets/domains/managed.py index 0ced68fd5c5..d66bd107955 100644 --- a/src/cloudflare/resources/r2/buckets/domains/managed.py +++ b/src/cloudflare/resources/r2/buckets/domains/managed.py @@ -50,7 +50,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -111,7 +109,7 @@ def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -189,7 +185,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -219,8 +215,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -250,7 +244,7 @@ async def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -277,8 +271,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/event_notifications.py b/src/cloudflare/resources/r2/buckets/event_notifications.py index 93613fcaf8e..972a23ad08f 100644 --- a/src/cloudflare/resources/r2/buckets/event_notifications.py +++ b/src/cloudflare/resources/r2/buckets/event_notifications.py @@ -50,7 +50,7 @@ def update( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, rules: Iterable[event_notification_update_params.Rule], jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -83,8 +83,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -117,7 +115,7 @@ def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -144,8 +142,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -174,7 +170,7 @@ def delete( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -206,8 +202,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -239,7 +233,7 @@ def get( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -269,8 +263,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -323,7 +315,7 @@ async def update( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, rules: Iterable[event_notification_update_params.Rule], jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -356,8 +348,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -392,7 +382,7 @@ async def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -419,8 +409,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -449,7 +437,7 @@ async def delete( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -481,8 +469,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -514,7 +500,7 @@ async def get( self, queue_id: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -544,8 +530,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/lifecycle.py b/src/cloudflare/resources/r2/buckets/lifecycle.py index 9f6a37aba29..44e0dd182ee 100644 --- a/src/cloudflare/resources/r2/buckets/lifecycle.py +++ b/src/cloudflare/resources/r2/buckets/lifecycle.py @@ -49,7 +49,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[lifecycle_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -108,7 +106,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -135,8 +133,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -186,7 +182,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[lifecycle_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -214,8 +210,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -245,7 +239,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,8 +266,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/locks.py b/src/cloudflare/resources/r2/buckets/locks.py index c704a5166d1..2ad4c836eed 100644 --- a/src/cloudflare/resources/r2/buckets/locks.py +++ b/src/cloudflare/resources/r2/buckets/locks.py @@ -49,7 +49,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[lock_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -106,7 +104,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -133,8 +131,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -182,7 +178,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, rules: Iterable[lock_update_params.Rule] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -210,8 +206,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -239,7 +233,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -266,8 +260,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/buckets/metrics.py b/src/cloudflare/resources/r2/buckets/metrics.py index 74747457e17..b8efb3cc5bc 100644 --- a/src/cloudflare/resources/r2/buckets/metrics.py +++ b/src/cloudflare/resources/r2/buckets/metrics.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> MetricsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -110,7 +108,7 @@ def with_streaming_response(self) -> AsyncMetricsResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_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, @@ -134,8 +132,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/r2/buckets/sippy.py b/src/cloudflare/resources/r2/buckets/sippy.py index 1d812c34a99..9903060a714 100644 --- a/src/cloudflare/resources/r2/buckets/sippy.py +++ b/src/cloudflare/resources/r2/buckets/sippy.py @@ -8,7 +8,7 @@ import httpx from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import is_given, path_template, maybe_transform, strip_not_given, async_maybe_transform +from ...._utils import is_given, path_template, required_args, maybe_transform, strip_not_given, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -51,7 +51,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | Omit = omit, source: sippy_update_params.R2EnableSippyAwsSource | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -91,7 +91,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | Omit = omit, source: sippy_update_params.R2EnableSippyGcsSource | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -131,7 +131,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyS3Destination | Omit = omit, source: sippy_update_params.R2EnableSippyS3Source | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -166,11 +166,12 @@ def update( """ ... + @required_args(["account_id"]) def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | sippy_update_params.R2EnableSippyGcsDestination | sippy_update_params.R2EnableSippyS3Destination @@ -187,8 +188,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -222,7 +221,7 @@ def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -249,8 +248,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -277,7 +274,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -304,8 +301,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -354,7 +349,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | Omit = omit, source: sippy_update_params.R2EnableSippyAwsSource | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -394,7 +389,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyGcsDestination | Omit = omit, source: sippy_update_params.R2EnableSippyGcsSource | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -434,7 +429,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyS3Destination | Omit = omit, source: sippy_update_params.R2EnableSippyS3Source | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -469,11 +464,12 @@ async def update( """ ... + @required_args(["account_id"]) async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, destination: sippy_update_params.R2EnableSippyAwsDestination | sippy_update_params.R2EnableSippyGcsDestination | sippy_update_params.R2EnableSippyS3Destination @@ -490,8 +486,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Sippy: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -525,7 +519,7 @@ async def delete( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -552,8 +546,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -580,7 +572,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -607,8 +599,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2/super_slurper/connectivity_precheck.py b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py index 7639235c36e..19a96aec881 100644 --- a/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py +++ b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> ConnectivityPrecheckResourceWithStreamingRe def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, vendor: Literal["s3"], @@ -85,7 +85,7 @@ def source( def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, vendor: Literal["gcs"], @@ -116,7 +116,7 @@ def source( def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Provider, @@ -144,11 +144,11 @@ def source( """ ... - @required_args(["bucket", "secret", "vendor"]) + @required_args(["account_id", "bucket", "secret", "vendor"]) def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret @@ -166,8 +166,6 @@ def source( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -200,7 +198,7 @@ def source( def target( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_target_params.Secret, vendor: Provider, @@ -224,8 +222,6 @@ def target( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -276,7 +272,7 @@ def with_streaming_response(self) -> AsyncConnectivityPrecheckResourceWithStream async def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, vendor: Literal["s3"], @@ -309,7 +305,7 @@ async def source( async def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, vendor: Literal["gcs"], @@ -340,7 +336,7 @@ async def source( async def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Provider, @@ -368,11 +364,11 @@ async def source( """ ... - @required_args(["bucket", "secret", "vendor"]) + @required_args(["account_id", "bucket", "secret", "vendor"]) async def source( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret | connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret @@ -390,8 +386,6 @@ async def source( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ConnectivityPrecheckSourceResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -424,7 +418,7 @@ async def source( async def target( self, *, - account_id: str | None = None, + account_id: str, bucket: str, secret: connectivity_precheck_target_params.Secret, vendor: Provider, @@ -448,8 +442,6 @@ async def target( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( diff --git a/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py b/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py index 4214cde360d..cd51b868310 100644 --- a/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py +++ b/src/cloudflare/resources/r2/super_slurper/jobs/jobs.py @@ -67,7 +67,7 @@ def with_streaming_response(self) -> JobsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, overwrite: bool | Omit = omit, source: job_create_params.Source | Omit = omit, target: job_create_params.Target | Omit = omit, @@ -91,8 +91,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -118,7 +116,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, limit: int | Omit = omit, offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -140,8 +138,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -167,7 +163,7 @@ def abort( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -189,8 +185,6 @@ def abort( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -210,7 +204,7 @@ def abort( def abort_all( self, *, - account_id: str | None = None, + account_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, @@ -233,8 +227,6 @@ def abort_all( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -253,7 +245,7 @@ def get( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -274,8 +266,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -296,7 +286,7 @@ def pause( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -318,8 +308,6 @@ def pause( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -340,7 +328,7 @@ def progress( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -360,8 +348,6 @@ def progress( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -384,7 +370,7 @@ def resume( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -405,8 +391,6 @@ def resume( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -451,7 +435,7 @@ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, overwrite: bool | Omit = omit, source: job_create_params.Source | Omit = omit, target: job_create_params.Target | Omit = omit, @@ -475,8 +459,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -502,7 +484,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, limit: int | Omit = omit, offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -524,8 +506,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -551,7 +531,7 @@ async def abort( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -573,8 +553,6 @@ async def abort( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -594,7 +572,7 @@ async def abort( async def abort_all( self, *, - account_id: str | None = None, + account_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, @@ -617,8 +595,6 @@ async def abort_all( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -637,7 +613,7 @@ async def get( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -658,8 +634,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -680,7 +654,7 @@ async def pause( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -702,8 +676,6 @@ async def pause( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -724,7 +696,7 @@ async def progress( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -744,8 +716,6 @@ async def progress( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -768,7 +738,7 @@ async def resume( self, job_id: str, *, - account_id: str | None = None, + account_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, @@ -789,8 +759,6 @@ async def resume( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: diff --git a/src/cloudflare/resources/r2/super_slurper/jobs/logs.py b/src/cloudflare/resources/r2/super_slurper/jobs/logs.py index 82ea9973b1d..477221683b3 100644 --- a/src/cloudflare/resources/r2/super_slurper/jobs/logs.py +++ b/src/cloudflare/resources/r2/super_slurper/jobs/logs.py @@ -46,7 +46,7 @@ def list( self, job_id: str, *, - account_id: str | None = None, + account_id: str, limit: int | Omit = omit, offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: @@ -119,7 +117,7 @@ def list( self, job_id: str, *, - account_id: str | None = None, + account_id: str, limit: int | Omit = omit, offset: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -142,8 +140,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not job_id: diff --git a/src/cloudflare/resources/r2/temporary_credentials.py b/src/cloudflare/resources/r2/temporary_credentials.py index 0fa765f4e28..6a2bf0702c5 100644 --- a/src/cloudflare/resources/r2/temporary_credentials.py +++ b/src/cloudflare/resources/r2/temporary_credentials.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> TemporaryCredentialsResourceWithStreamingRe def create( self, *, - account_id: str | None = None, + account_id: str, bucket: str, parent_access_key_id: str, permission: Literal["admin-read-write", "admin-read-only", "object-read-write", "object-read-only"], @@ -89,8 +89,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -140,7 +138,7 @@ def with_streaming_response(self) -> AsyncTemporaryCredentialsResourceWithStream async def create( self, *, - account_id: str | None = None, + account_id: str, bucket: str, parent_access_key_id: str, permission: Literal["admin-read-write", "admin-read-only", "object-read-write", "object-read-only"], @@ -181,8 +179,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/r2_data_catalog/credentials.py b/src/cloudflare/resources/r2_data_catalog/credentials.py index 799269c2605..20bce519bc5 100644 --- a/src/cloudflare/resources/r2_data_catalog/credentials.py +++ b/src/cloudflare/resources/r2_data_catalog/credentials.py @@ -47,7 +47,7 @@ def create( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, token: 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. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -124,7 +122,7 @@ async def create( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, token: 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. @@ -153,8 +151,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2_data_catalog/maintenance_configs.py b/src/cloudflare/resources/r2_data_catalog/maintenance_configs.py index c286cdd5c65..2d7341a6961 100644 --- a/src/cloudflare/resources/r2_data_catalog/maintenance_configs.py +++ b/src/cloudflare/resources/r2_data_catalog/maintenance_configs.py @@ -49,7 +49,7 @@ def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, compaction: maintenance_config_update_params.Compaction | Omit = omit, snapshot_expiration: maintenance_config_update_params.SnapshotExpiration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -81,8 +81,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -116,7 +114,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -141,8 +139,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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,7 +184,7 @@ async def update( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, compaction: maintenance_config_update_params.Compaction | Omit = omit, snapshot_expiration: maintenance_config_update_params.SnapshotExpiration | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -220,8 +216,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -255,7 +249,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -280,8 +274,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2_data_catalog/namespaces/namespaces.py b/src/cloudflare/resources/r2_data_catalog/namespaces/namespaces.py index ef66e5c123b..fe1388322c4 100644 --- a/src/cloudflare/resources/r2_data_catalog/namespaces/namespaces.py +++ b/src/cloudflare/resources/r2_data_catalog/namespaces/namespaces.py @@ -60,7 +60,7 @@ def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, page_size: int | Omit = omit, page_token: str | Omit = omit, parent: str | Omit = omit, @@ -106,8 +106,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -167,7 +165,7 @@ async def list( self, bucket_name: str, *, - account_id: str | None = None, + account_id: str, page_size: int | Omit = omit, page_token: str | Omit = omit, parent: str | Omit = omit, @@ -213,8 +211,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2_data_catalog/namespaces/tables/maintenance_configs.py b/src/cloudflare/resources/r2_data_catalog/namespaces/tables/maintenance_configs.py index cded2e8c16e..7a525734ab9 100644 --- a/src/cloudflare/resources/r2_data_catalog/namespaces/tables/maintenance_configs.py +++ b/src/cloudflare/resources/r2_data_catalog/namespaces/tables/maintenance_configs.py @@ -51,7 +51,7 @@ def update( self, table_name: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, namespace: str, compaction: maintenance_config_update_params.Compaction | Omit = omit, @@ -85,8 +85,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -126,7 +124,7 @@ def get( self, table_name: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, namespace: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -153,8 +151,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -206,7 +202,7 @@ async def update( self, table_name: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, namespace: str, compaction: maintenance_config_update_params.Compaction | Omit = omit, @@ -240,8 +236,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -281,7 +275,7 @@ async def get( self, table_name: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, namespace: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -308,8 +302,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2_data_catalog/namespaces/tables/tables.py b/src/cloudflare/resources/r2_data_catalog/namespaces/tables/tables.py index fae6540c757..f9427b809dc 100644 --- a/src/cloudflare/resources/r2_data_catalog/namespaces/tables/tables.py +++ b/src/cloudflare/resources/r2_data_catalog/namespaces/tables/tables.py @@ -60,7 +60,7 @@ def list( self, namespace: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, page_size: int | Omit = omit, page_token: str | Omit = omit, @@ -102,8 +102,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -165,7 +163,7 @@ async def list( self, namespace: str, *, - account_id: str | None = None, + account_id: str, bucket_name: str, page_size: int | Omit = omit, page_token: str | Omit = omit, @@ -207,8 +205,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/r2_data_catalog/r2_data_catalog.py b/src/cloudflare/resources/r2_data_catalog/r2_data_catalog.py index a201b27315a..107cd9ade79 100644 --- a/src/cloudflare/resources/r2_data_catalog/r2_data_catalog.py +++ b/src/cloudflare/resources/r2_data_catalog/r2_data_catalog.py @@ -84,7 +84,7 @@ def with_streaming_response(self) -> R2DataCatalogResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -108,8 +108,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -128,7 +126,7 @@ def disable( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -154,8 +152,6 @@ def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -177,7 +173,7 @@ def enable( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -204,8 +200,6 @@ def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -228,7 +222,7 @@ def get( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +247,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -309,7 +301,7 @@ def with_streaming_response(self) -> AsyncR2DataCatalogResourceWithStreamingResp async def list( self, *, - account_id: str | None = None, + account_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, @@ -333,8 +325,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -353,7 +343,7 @@ async def disable( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -379,8 +369,6 @@ async def disable( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -402,7 +390,7 @@ async def enable( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -429,8 +417,6 @@ async def enable( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bucket_name: @@ -453,7 +439,7 @@ async def get( self, bucket_name: str, *, - account_id: str | None = None, + account_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, @@ -478,8 +464,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() 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/rate_limits.py b/src/cloudflare/resources/rate_limits.py deleted file mode 100644 index 31110953cfa..00000000000 --- a/src/cloudflare/resources/rate_limits.py +++ /dev/null @@ -1,775 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import typing_extensions -from typing import Type, cast - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from ..pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from .._base_client import AsyncPaginator, make_request_options -from ..types.rate_limits import rate_limit_edit_params, rate_limit_list_params, rate_limit_create_params -from ..types.rate_limits.rate_limit import RateLimit -from ..types.rate_limits.rate_limit_delete_response import RateLimitDeleteResponse - -__all__ = ["RateLimitsResource", "AsyncRateLimitsResource"] - - -class RateLimitsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RateLimitsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return RateLimitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RateLimitsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return RateLimitsResourceWithStreamingResponse(self) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def create( - self, - *, - zone_id: str, - action: rate_limit_create_params.Action, - match: rate_limit_create_params.Match, - period: float, - threshold: float, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RateLimit: - """Creates a new rate limit for a zone. - - Refer to the object definition for a list - of required attributes. - - Args: - zone_id: Defines an identifier. - - action: The action to perform when the threshold of matched traffic within the - configured period is exceeded. - - match: Determines which traffic the rate limit counts towards the threshold. - - period: The time in seconds (an integer value) to count matching traffic. If the count - exceeds the configured threshold within this period, Cloudflare will perform the - configured action. - - threshold: The threshold that will trigger the configured mitigation action. Configure this - value along with the `period` property to establish a threshold per period. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/rate_limits", - body=maybe_transform( - { - "action": action, - "match": match, - "period": period, - "threshold": threshold, - }, - rate_limit_create_params.RateLimitCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def list( - self, - *, - zone_id: str, - page: float | Omit = omit, - per_page: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[RateLimit]: - """ - Fetches the rate limits for a zone. - - Args: - zone_id: Defines an identifier. - - page: Defines the page number of paginated results. - - per_page: Defines the maximum number of results per page. You can only set the value to - `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/rate_limits", - page=SyncV4PagePaginationArray[RateLimit], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - }, - rate_limit_list_params.RateLimitListParams, - ), - ), - model=RateLimit, - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def delete( - self, - rate_limit_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, - ) -> RateLimitDeleteResponse: - """ - Deletes an existing rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return self._delete( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimitDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[RateLimitDeleteResponse], ResultWrapper[RateLimitDeleteResponse]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def edit( - self, - rate_limit_id: str, - *, - zone_id: str, - action: rate_limit_edit_params.Action, - match: rate_limit_edit_params.Match, - period: float, - threshold: float, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RateLimit: - """ - Updates an existing rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - action: The action to perform when the threshold of matched traffic within the - configured period is exceeded. - - match: Determines which traffic the rate limit counts towards the threshold. - - period: The time in seconds (an integer value) to count matching traffic. If the count - exceeds the configured threshold within this period, Cloudflare will perform the - configured action. - - threshold: The threshold that will trigger the configured mitigation action. Configure this - value along with the `period` property to establish a threshold per period. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return self._put( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - body=maybe_transform( - { - "action": action, - "match": match, - "period": period, - "threshold": threshold, - }, - rate_limit_edit_params.RateLimitEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def get( - self, - rate_limit_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, - ) -> RateLimit: - """ - Fetches the details of a rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return self._get( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - -class AsyncRateLimitsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRateLimitsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncRateLimitsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRateLimitsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncRateLimitsResourceWithStreamingResponse(self) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - async def create( - self, - *, - zone_id: str, - action: rate_limit_create_params.Action, - match: rate_limit_create_params.Match, - period: float, - threshold: float, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RateLimit: - """Creates a new rate limit for a zone. - - Refer to the object definition for a list - of required attributes. - - Args: - zone_id: Defines an identifier. - - action: The action to perform when the threshold of matched traffic within the - configured period is exceeded. - - match: Determines which traffic the rate limit counts towards the threshold. - - period: The time in seconds (an integer value) to count matching traffic. If the count - exceeds the configured threshold within this period, Cloudflare will perform the - configured action. - - threshold: The threshold that will trigger the configured mitigation action. Configure this - value along with the `period` property to establish a threshold per period. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._post( - f"/zones/{zone_id}/rate_limits", - body=await async_maybe_transform( - { - "action": action, - "match": match, - "period": period, - "threshold": threshold, - }, - rate_limit_create_params.RateLimitCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - def list( - self, - *, - zone_id: str, - page: float | Omit = omit, - per_page: float | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this 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[RateLimit, AsyncV4PagePaginationArray[RateLimit]]: - """ - Fetches the rate limits for a zone. - - Args: - zone_id: Defines an identifier. - - page: Defines the page number of paginated results. - - per_page: Defines the maximum number of results per page. You can only set the value to - `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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}/rate_limits", - page=AsyncV4PagePaginationArray[RateLimit], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - }, - rate_limit_list_params.RateLimitListParams, - ), - ), - model=RateLimit, - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - async def delete( - self, - rate_limit_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, - ) -> RateLimitDeleteResponse: - """ - Deletes an existing rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return await self._delete( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimitDeleteResponse]._unwrapper, - ), - cast_to=cast(Type[RateLimitDeleteResponse], ResultWrapper[RateLimitDeleteResponse]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - async def edit( - self, - rate_limit_id: str, - *, - zone_id: str, - action: rate_limit_edit_params.Action, - match: rate_limit_edit_params.Match, - period: float, - threshold: float, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RateLimit: - """ - Updates an existing rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - action: The action to perform when the threshold of matched traffic within the - configured period is exceeded. - - match: Determines which traffic the rate limit counts towards the threshold. - - period: The time in seconds (an integer value) to count matching traffic. If the count - exceeds the configured threshold within this period, Cloudflare will perform the - configured action. - - threshold: The threshold that will trigger the configured mitigation action. Configure this - value along with the `period` property to establish a threshold per period. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return await self._put( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - body=await async_maybe_transform( - { - "action": action, - "match": match, - "period": period, - "threshold": threshold, - }, - rate_limit_edit_params.RateLimitEditParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - @typing_extensions.deprecated( - "Rate limiting API is deprecated in favour of using the Ruleset Engine. See https://developers.cloudflare.com/fundamentals/api/reference/deprecations/#rate-limiting-api-previous-version for full details." - ) - async def get( - self, - rate_limit_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, - ) -> RateLimit: - """ - Fetches the details of a rate limit. - - Args: - zone_id: Defines an identifier. - - rate_limit_id: Defines the unique identifier of the rate limit. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 rate_limit_id: - raise ValueError(f"Expected a non-empty value for `rate_limit_id` but received {rate_limit_id!r}") - return await self._get( - f"/zones/{zone_id}/rate_limits/{rate_limit_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[RateLimit]._unwrapper, - ), - cast_to=cast(Type[RateLimit], ResultWrapper[RateLimit]), - ) - - -class RateLimitsResourceWithRawResponse: - def __init__(self, rate_limits: RateLimitsResource) -> None: - self._rate_limits = rate_limits - - self.create = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - rate_limits.create, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - rate_limits.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - rate_limits.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.edit = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - rate_limits.edit, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - rate_limits.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncRateLimitsResourceWithRawResponse: - def __init__(self, rate_limits: AsyncRateLimitsResource) -> None: - self._rate_limits = rate_limits - - self.create = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - rate_limits.create, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - rate_limits.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - rate_limits.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.edit = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - rate_limits.edit, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - rate_limits.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class RateLimitsResourceWithStreamingResponse: - def __init__(self, rate_limits: RateLimitsResource) -> None: - self._rate_limits = rate_limits - - self.create = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - rate_limits.create, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - rate_limits.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - rate_limits.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.edit = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - rate_limits.edit, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - rate_limits.get, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncRateLimitsResourceWithStreamingResponse: - def __init__(self, rate_limits: AsyncRateLimitsResource) -> None: - self._rate_limits = rate_limits - - self.create = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - rate_limits.create, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - rate_limits.list, # pyright: ignore[reportDeprecated], - ) - ) - self.delete = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - rate_limits.delete, # pyright: ignore[reportDeprecated], - ) - ) - self.edit = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - rate_limits.edit, # pyright: ignore[reportDeprecated], - ) - ) - self.get = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - rate_limits.get, # pyright: ignore[reportDeprecated], - ) - ) diff --git a/src/cloudflare/resources/rate_limits/rate_limits.py b/src/cloudflare/resources/rate_limits/rate_limits.py index a604abb93f8..cdbb215d962 100644 --- a/src/cloudflare/resources/rate_limits/rate_limits.py +++ b/src/cloudflare/resources/rate_limits/rate_limits.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> RateLimitsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, action: rate_limit_create_params.Action, match: rate_limit_create_params.Match, period: float, @@ -93,8 +93,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -124,7 +122,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -153,8 +151,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -183,7 +179,7 @@ def delete( self, rate_limit_id: str, *, - zone_id: str | None = None, + 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, @@ -207,8 +203,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: @@ -232,7 +226,7 @@ def edit( self, rate_limit_id: str, *, - zone_id: str | None = None, + zone_id: str, action: rate_limit_edit_params.Action, match: rate_limit_edit_params.Match, period: float, @@ -272,8 +266,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: @@ -306,7 +298,7 @@ def get( self, rate_limit_id: str, *, - zone_id: str | None = None, + 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, @@ -330,8 +322,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: @@ -375,7 +365,7 @@ def with_streaming_response(self) -> AsyncRateLimitsResourceWithStreamingRespons async def create( self, *, - zone_id: str | None = None, + zone_id: str, action: rate_limit_create_params.Action, match: rate_limit_create_params.Match, period: float, @@ -415,8 +405,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -446,7 +434,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -475,8 +463,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -505,7 +491,7 @@ async def delete( self, rate_limit_id: str, *, - zone_id: str | None = None, + 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, @@ -529,8 +515,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: @@ -554,7 +538,7 @@ async def edit( self, rate_limit_id: str, *, - zone_id: str | None = None, + zone_id: str, action: rate_limit_edit_params.Action, match: rate_limit_edit_params.Match, period: float, @@ -594,8 +578,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: @@ -628,7 +610,7 @@ async def get( self, rate_limit_id: str, *, - zone_id: str | None = None, + 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, @@ -652,8 +634,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rate_limit_id: diff --git a/src/cloudflare/resources/realtime_kit/active_session.py b/src/cloudflare/resources/realtime_kit/active_session.py index 2a40dc86148..c7bbada5441 100644 --- a/src/cloudflare/resources/realtime_kit/active_session.py +++ b/src/cloudflare/resources/realtime_kit/active_session.py @@ -48,7 +48,7 @@ def create_poll( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, options: SequenceNotStr[str], question: str, @@ -85,8 +85,6 @@ def create_poll( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -119,7 +117,7 @@ def get_active_session( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -144,8 +142,6 @@ def get_active_session( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -169,7 +165,7 @@ def kick_all_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -194,8 +190,6 @@ def kick_all_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -219,7 +213,7 @@ def kick_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, custom_participant_ids: SequenceNotStr[str], participant_ids: SequenceNotStr[str], @@ -247,8 +241,6 @@ def kick_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -300,7 +292,7 @@ async def create_poll( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, options: SequenceNotStr[str], question: str, @@ -337,8 +329,6 @@ async def create_poll( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -371,7 +361,7 @@ async def get_active_session( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -396,8 +386,6 @@ async def get_active_session( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -421,7 +409,7 @@ async def kick_all_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -446,8 +434,6 @@ async def kick_all_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -471,7 +457,7 @@ async def kick_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, custom_participant_ids: SequenceNotStr[str], participant_ids: SequenceNotStr[str], @@ -499,8 +485,6 @@ async def kick_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/analytics.py b/src/cloudflare/resources/realtime_kit/analytics.py index ca0c626bb06..b759b910eac 100644 --- a/src/cloudflare/resources/realtime_kit/analytics.py +++ b/src/cloudflare/resources/realtime_kit/analytics.py @@ -45,7 +45,7 @@ def get_org_analytics( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_date: str | Omit = omit, start_date: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def get_org_analytics( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -128,7 +126,7 @@ async def get_org_analytics( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_date: str | Omit = omit, start_date: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,8 +158,6 @@ async def get_org_analytics( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/apps.py b/src/cloudflare/resources/realtime_kit/apps.py index 9910f332817..1d030d18f9f 100644 --- a/src/cloudflare/resources/realtime_kit/apps.py +++ b/src/cloudflare/resources/realtime_kit/apps.py @@ -45,7 +45,7 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -82,7 +80,7 @@ def get( def post( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -103,8 +101,6 @@ def post( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -140,7 +136,7 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -162,8 +158,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -177,7 +171,7 @@ async def get( async def post( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -198,8 +192,6 @@ async def post( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/realtime_kit/livestreams.py b/src/cloudflare/resources/realtime_kit/livestreams.py index 49a1ff212ca..10663fa2d29 100644 --- a/src/cloudflare/resources/realtime_kit/livestreams.py +++ b/src/cloudflare/resources/realtime_kit/livestreams.py @@ -81,7 +81,7 @@ def create_independent_livestream( self, app_id: str, *, - account_id: str | None = None, + account_id: str, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -111,8 +111,6 @@ def create_independent_livestream( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -135,7 +133,7 @@ def get_active_livestreams_for_livestream_id( self, livestream_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -162,8 +160,6 @@ def get_active_livestreams_for_livestream_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -187,7 +183,7 @@ def get_all_livestreams( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, exclude_meetings: bool | Omit = omit, page_no: int | Omit = omit, @@ -236,8 +232,6 @@ def get_all_livestreams( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -271,7 +265,7 @@ def get_livestream_analytics_complete( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, start_time: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -301,8 +295,6 @@ def get_livestream_analytics_complete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -333,7 +325,7 @@ def get_livestream_session_details_for_session_id( self, livestream_session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -361,8 +353,6 @@ def get_livestream_session_details_for_session_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -388,7 +378,7 @@ def get_livestream_session_for_livestream_id( self, livestream_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, page_no: int | Omit = omit, per_page: int | Omit = omit, @@ -420,8 +410,6 @@ def get_livestream_session_for_livestream_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -455,7 +443,7 @@ def get_meeting_active_livestreams( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -480,8 +468,6 @@ def get_meeting_active_livestreams( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -505,7 +491,7 @@ def get_org_analytics( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_date: str | Omit = omit, start_date: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -537,8 +523,6 @@ def get_org_analytics( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -567,7 +551,7 @@ def start_livestreaming_a_meeting( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, name: Optional[str] | Omit = omit, video_config: livestream_start_livestreaming_a_meeting_params.VideoConfig | Omit = omit, @@ -596,8 +580,6 @@ def start_livestreaming_a_meeting( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -628,7 +610,7 @@ def stop_livestreaming_a_meeting( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -654,8 +636,6 @@ def stop_livestreaming_a_meeting( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -700,7 +680,7 @@ async def create_independent_livestream( self, app_id: str, *, - account_id: str | None = None, + account_id: str, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -730,8 +710,6 @@ async def create_independent_livestream( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -754,7 +732,7 @@ async def get_active_livestreams_for_livestream_id( self, livestream_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -781,8 +759,6 @@ async def get_active_livestreams_for_livestream_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -806,7 +782,7 @@ async def get_all_livestreams( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, exclude_meetings: bool | Omit = omit, page_no: int | Omit = omit, @@ -855,8 +831,6 @@ async def get_all_livestreams( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -890,7 +864,7 @@ async def get_livestream_analytics_complete( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, start_time: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -920,8 +894,6 @@ async def get_livestream_analytics_complete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -952,7 +924,7 @@ async def get_livestream_session_details_for_session_id( self, livestream_session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -980,8 +952,6 @@ async def get_livestream_session_details_for_session_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1007,7 +977,7 @@ async def get_livestream_session_for_livestream_id( self, livestream_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, page_no: int | Omit = omit, per_page: int | Omit = omit, @@ -1039,8 +1009,6 @@ async def get_livestream_session_for_livestream_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1074,7 +1042,7 @@ async def get_meeting_active_livestreams( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -1099,8 +1067,6 @@ async def get_meeting_active_livestreams( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1124,7 +1090,7 @@ async def get_org_analytics( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_date: str | Omit = omit, start_date: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1156,8 +1122,6 @@ async def get_org_analytics( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1186,7 +1150,7 @@ async def start_livestreaming_a_meeting( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, name: Optional[str] | Omit = omit, video_config: livestream_start_livestreaming_a_meeting_params.VideoConfig | Omit = omit, @@ -1215,8 +1179,6 @@ async def start_livestreaming_a_meeting( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1247,7 +1209,7 @@ async def stop_livestreaming_a_meeting( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -1273,8 +1235,6 @@ async def stop_livestreaming_a_meeting( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/meetings.py b/src/cloudflare/resources/realtime_kit/meetings.py index baa0a9e0000..c82b9e20b59 100644 --- a/src/cloudflare/resources/realtime_kit/meetings.py +++ b/src/cloudflare/resources/realtime_kit/meetings.py @@ -68,7 +68,7 @@ def create( self, app_id: str, *, - account_id: str | None = None, + account_id: str, ai_config: meeting_create_params.AIConfig | Omit = omit, live_stream_on_start: Optional[bool] | Omit = omit, persist_chat: bool | Omit = omit, @@ -123,8 +123,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -156,7 +154,7 @@ def add_participant( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, custom_participant_id: str, preset_name: str, @@ -194,8 +192,6 @@ def add_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -228,7 +224,7 @@ def delete_meeting_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -254,8 +250,6 @@ def delete_meeting_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -282,7 +276,7 @@ def edit_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, name: Optional[str] | Omit = omit, @@ -317,8 +311,6 @@ def edit_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -353,7 +345,7 @@ def get( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, page_no: float | Omit = omit, per_page: float | Omit = omit, @@ -394,8 +386,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -427,7 +417,7 @@ def get_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -453,8 +443,6 @@ def get_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -482,7 +470,7 @@ def get_meeting_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -508,8 +496,6 @@ def get_meeting_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -536,7 +522,7 @@ def get_meeting_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, page_no: float | Omit = omit, per_page: float | Omit = omit, @@ -567,8 +553,6 @@ def get_meeting_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -602,7 +586,7 @@ def refresh_participant_token( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -629,8 +613,6 @@ def refresh_participant_token( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -657,7 +639,7 @@ def replace_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, ai_config: meeting_replace_meeting_by_id_params.AIConfig | Omit = omit, live_stream_on_start: Optional[bool] | Omit = omit, @@ -713,8 +695,6 @@ def replace_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -751,7 +731,7 @@ def update_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, ai_config: meeting_update_meeting_by_id_params.AIConfig | Omit = omit, live_stream_on_start: bool | Omit = omit, @@ -806,8 +786,6 @@ def update_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -865,7 +843,7 @@ async def create( self, app_id: str, *, - account_id: str | None = None, + account_id: str, ai_config: meeting_create_params.AIConfig | Omit = omit, live_stream_on_start: Optional[bool] | Omit = omit, persist_chat: bool | Omit = omit, @@ -920,8 +898,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -953,7 +929,7 @@ async def add_participant( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, custom_participant_id: str, preset_name: str, @@ -991,8 +967,6 @@ async def add_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1025,7 +999,7 @@ async def delete_meeting_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1051,8 +1025,6 @@ async def delete_meeting_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1079,7 +1051,7 @@ async def edit_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, name: Optional[str] | Omit = omit, @@ -1114,8 +1086,6 @@ async def edit_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1150,7 +1120,7 @@ async def get( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, page_no: float | Omit = omit, per_page: float | Omit = omit, @@ -1191,8 +1161,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1224,7 +1192,7 @@ async def get_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1250,8 +1218,6 @@ async def get_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1281,7 +1247,7 @@ async def get_meeting_participant( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1307,8 +1273,6 @@ async def get_meeting_participant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1335,7 +1299,7 @@ async def get_meeting_participants( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, page_no: float | Omit = omit, per_page: float | Omit = omit, @@ -1366,8 +1330,6 @@ async def get_meeting_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1401,7 +1363,7 @@ async def refresh_participant_token( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, meeting_id: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1428,8 +1390,6 @@ async def refresh_participant_token( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1456,7 +1416,7 @@ async def replace_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, ai_config: meeting_replace_meeting_by_id_params.AIConfig | Omit = omit, live_stream_on_start: Optional[bool] | Omit = omit, @@ -1512,8 +1472,6 @@ async def replace_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1550,7 +1508,7 @@ async def update_meeting_by_id( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, ai_config: meeting_update_meeting_by_id_params.AIConfig | Omit = omit, live_stream_on_start: bool | Omit = omit, @@ -1605,8 +1563,6 @@ async def update_meeting_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/presets.py b/src/cloudflare/resources/realtime_kit/presets.py index 8a9e4faa2c9..8b8753452e8 100644 --- a/src/cloudflare/resources/realtime_kit/presets.py +++ b/src/cloudflare/resources/realtime_kit/presets.py @@ -49,7 +49,7 @@ def create( self, app_id: str, *, - account_id: str | None = None, + account_id: str, config: preset_create_params.Config, name: str, ui: preset_create_params.UI, @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -106,7 +104,7 @@ def update( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, config: preset_update_params.Config | Omit = omit, name: str | Omit = omit, @@ -137,8 +135,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -171,7 +167,7 @@ def delete( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -196,8 +192,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -221,7 +215,7 @@ def get( self, app_id: str, *, - account_id: str | None = None, + account_id: str, page_no: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -251,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -279,7 +271,7 @@ def get_preset_by_id( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -304,8 +296,6 @@ def get_preset_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -350,7 +340,7 @@ async def create( self, app_id: str, *, - account_id: str | None = None, + account_id: str, config: preset_create_params.Config, name: str, ui: preset_create_params.UI, @@ -380,8 +370,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -407,7 +395,7 @@ async def update( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, config: preset_update_params.Config | Omit = omit, name: str | Omit = omit, @@ -438,8 +426,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -472,7 +458,7 @@ async def delete( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -497,8 +483,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -522,7 +506,7 @@ async def get( self, app_id: str, *, - account_id: str | None = None, + account_id: str, page_no: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -552,8 +536,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -580,7 +562,7 @@ async def get_preset_by_id( self, preset_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -605,8 +587,6 @@ async def get_preset_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/recordings.py b/src/cloudflare/resources/realtime_kit/recordings.py index 1d3ffc6aa6b..b3495b7510f 100644 --- a/src/cloudflare/resources/realtime_kit/recordings.py +++ b/src/cloudflare/resources/realtime_kit/recordings.py @@ -60,7 +60,7 @@ def get_active_recordings( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -85,8 +85,6 @@ def get_active_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -110,7 +108,7 @@ def get_one_recording( self, recording_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -135,8 +133,6 @@ def get_one_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -160,7 +156,7 @@ def get_recordings( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, expired: bool | Omit = omit, meeting_id: str | Omit = omit, @@ -214,8 +210,6 @@ def get_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -252,7 +246,7 @@ def pause_resume_stop_recording( self, recording_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, action: Literal["stop", "pause", "resume"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -276,8 +270,6 @@ def pause_resume_stop_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -304,7 +296,7 @@ def start_recordings( self, app_id: str, *, - account_id: str | None = None, + account_id: str, allow_multiple_recordings: bool | Omit = omit, audio_config: recording_start_recordings_params.AudioConfig | Omit = omit, file_name_prefix: str | Omit = omit, @@ -365,8 +357,6 @@ def start_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -401,7 +391,7 @@ def start_track_recording( self, app_id: str, *, - account_id: str | None = None, + account_id: str, layers: Dict[str, recording_start_track_recording_params.Layers], meeting_id: str, max_seconds: float | Omit = omit, @@ -436,8 +426,6 @@ def start_track_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -486,7 +474,7 @@ async def get_active_recordings( self, meeting_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -511,8 +499,6 @@ async def get_active_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -536,7 +522,7 @@ async def get_one_recording( self, recording_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -561,8 +547,6 @@ async def get_one_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -586,7 +570,7 @@ async def get_recordings( self, app_id: str, *, - account_id: str | None = None, + account_id: str, end_time: Union[str, datetime] | Omit = omit, expired: bool | Omit = omit, meeting_id: str | Omit = omit, @@ -640,8 +624,6 @@ async def get_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -678,7 +660,7 @@ async def pause_resume_stop_recording( self, recording_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, action: Literal["stop", "pause", "resume"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -702,8 +684,6 @@ async def pause_resume_stop_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -730,7 +710,7 @@ async def start_recordings( self, app_id: str, *, - account_id: str | None = None, + account_id: str, allow_multiple_recordings: bool | Omit = omit, audio_config: recording_start_recordings_params.AudioConfig | Omit = omit, file_name_prefix: str | Omit = omit, @@ -791,8 +771,6 @@ async def start_recordings( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -827,7 +805,7 @@ async def start_track_recording( self, app_id: str, *, - account_id: str | None = None, + account_id: str, layers: Dict[str, recording_start_track_recording_params.Layers], meeting_id: str, max_seconds: float | Omit = omit, @@ -862,8 +840,6 @@ async def start_track_recording( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/sessions.py b/src/cloudflare/resources/realtime_kit/sessions.py index d4bd6f90710..9d94ac7a82d 100644 --- a/src/cloudflare/resources/realtime_kit/sessions.py +++ b/src/cloudflare/resources/realtime_kit/sessions.py @@ -66,7 +66,7 @@ def generate_summary_of_transcripts( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -91,8 +91,6 @@ def generate_summary_of_transcripts( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -117,7 +115,7 @@ def get_participant_data_from_peer_id( self, peer_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, filters: Literal["device_info", "ip_information", "precall_network_information", "events", "quality_stats"] | Omit = omit, @@ -148,8 +146,6 @@ def get_participant_data_from_peer_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -180,7 +176,7 @@ def get_session_chat( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -205,8 +201,6 @@ def get_session_chat( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -230,7 +224,7 @@ def get_session_details( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, include_breakout_rooms: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -258,8 +252,6 @@ def get_session_details( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -290,7 +282,7 @@ def get_session_participant_details( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, session_id: str, filters: Literal["device_info", "ip_information", "precall_network_information", "events", "quality_stats"] @@ -325,8 +317,6 @@ def get_session_participant_details( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -363,7 +353,7 @@ def get_session_participants( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, include_peer_events: bool | Omit = omit, page_no: float | Omit = omit, @@ -407,8 +397,6 @@ def get_session_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -447,7 +435,7 @@ def get_session_summary( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -473,8 +461,6 @@ def get_session_summary( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -498,7 +484,7 @@ def get_session_transcripts( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -523,8 +509,6 @@ def get_session_transcripts( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -548,7 +532,7 @@ def get_sessions( self, app_id: str, *, - account_id: str | None = None, + account_id: str, associated_id: str | Omit = omit, end_time: Union[str, datetime] | Omit = omit, page_no: float | Omit = omit, @@ -597,8 +581,6 @@ def get_sessions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -656,7 +638,7 @@ async def generate_summary_of_transcripts( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -681,8 +663,6 @@ async def generate_summary_of_transcripts( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -707,7 +687,7 @@ async def get_participant_data_from_peer_id( self, peer_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, filters: Literal["device_info", "ip_information", "precall_network_information", "events", "quality_stats"] | Omit = omit, @@ -738,8 +718,6 @@ async def get_participant_data_from_peer_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -770,7 +748,7 @@ async def get_session_chat( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -795,8 +773,6 @@ async def get_session_chat( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -820,7 +796,7 @@ async def get_session_details( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, include_breakout_rooms: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -848,8 +824,6 @@ async def get_session_details( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -880,7 +854,7 @@ async def get_session_participant_details( self, participant_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, session_id: str, filters: Literal["device_info", "ip_information", "precall_network_information", "events", "quality_stats"] @@ -915,8 +889,6 @@ async def get_session_participant_details( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -953,7 +925,7 @@ async def get_session_participants( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, include_peer_events: bool | Omit = omit, page_no: float | Omit = omit, @@ -997,8 +969,6 @@ async def get_session_participants( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1037,7 +1007,7 @@ async def get_session_summary( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -1063,8 +1033,6 @@ async def get_session_summary( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1088,7 +1056,7 @@ async def get_session_transcripts( self, session_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -1113,8 +1081,6 @@ async def get_session_transcripts( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -1138,7 +1104,7 @@ async def get_sessions( self, app_id: str, *, - account_id: str | None = None, + account_id: str, associated_id: str | Omit = omit, end_time: Union[str, datetime] | Omit = omit, page_no: float | Omit = omit, @@ -1187,8 +1153,6 @@ async def get_sessions( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/realtime_kit/webhooks.py b/src/cloudflare/resources/realtime_kit/webhooks.py index fb95970b161..54c60943b1d 100644 --- a/src/cloudflare/resources/realtime_kit/webhooks.py +++ b/src/cloudflare/resources/realtime_kit/webhooks.py @@ -57,7 +57,7 @@ def create_webhook( self, app_id: str, *, - account_id: str | None = None, + account_id: str, events: List[ Literal[ "meeting.started", @@ -105,8 +105,6 @@ def create_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -134,7 +132,7 @@ def delete_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -159,8 +157,6 @@ def delete_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -184,7 +180,7 @@ def edit_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, enabled: bool | Omit = omit, events: List[ @@ -232,8 +228,6 @@ def edit_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -266,7 +260,7 @@ def get_webhook_by_id( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -291,8 +285,6 @@ def get_webhook_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -316,7 +308,7 @@ def get_webhooks( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -340,8 +332,6 @@ def get_webhooks( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -360,7 +350,7 @@ def replace_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, events: List[ Literal[ @@ -409,8 +399,6 @@ def replace_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -464,7 +452,7 @@ async def create_webhook( self, app_id: str, *, - account_id: str | None = None, + account_id: str, events: List[ Literal[ "meeting.started", @@ -512,8 +500,6 @@ async def create_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -541,7 +527,7 @@ async def delete_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -566,8 +552,6 @@ async def delete_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -591,7 +575,7 @@ async def edit_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, enabled: bool | Omit = omit, events: List[ @@ -639,8 +623,6 @@ async def edit_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -673,7 +655,7 @@ async def get_webhook_by_id( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_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. @@ -698,8 +680,6 @@ async def get_webhook_by_id( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -723,7 +703,7 @@ async def get_webhooks( self, app_id: str, *, - account_id: str | None = None, + account_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, @@ -747,8 +727,6 @@ async def get_webhooks( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: @@ -767,7 +745,7 @@ async def replace_webhook( self, webhook_id: str, *, - account_id: str | None = None, + account_id: str, app_id: str, events: List[ Literal[ @@ -816,8 +794,6 @@ async def replace_webhook( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not app_id: diff --git a/src/cloudflare/resources/registrar/domains.py b/src/cloudflare/resources/registrar/domains.py index ce5c9324207..ae2c16a1aa5 100644 --- a/src/cloudflare/resources/registrar/domains.py +++ b/src/cloudflare/resources/registrar/domains.py @@ -53,7 +53,7 @@ def update( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, auto_renew: bool | Omit = omit, locked: bool | Omit = omit, privacy: bool | Omit = omit, @@ -90,8 +90,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -124,7 +122,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -146,8 +144,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -166,7 +162,7 @@ def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -193,8 +189,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -241,7 +235,7 @@ async def update( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, auto_renew: bool | Omit = omit, locked: bool | Omit = omit, privacy: bool | Omit = omit, @@ -278,8 +272,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -312,7 +304,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -334,8 +326,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -354,7 +344,7 @@ async def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -381,8 +371,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: diff --git a/src/cloudflare/resources/registrar/registrar.py b/src/cloudflare/resources/registrar/registrar.py index 4fd37350fa0..8600f3169b0 100644 --- a/src/cloudflare/resources/registrar/registrar.py +++ b/src/cloudflare/resources/registrar/registrar.py @@ -96,7 +96,7 @@ def with_streaming_response(self) -> RegistrarResourceWithStreamingResponse: def check( self, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[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. @@ -175,8 +175,6 @@ def check( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -195,7 +193,7 @@ def check( def search( self, *, - account_id: str | None = None, + account_id: str, q: str, extensions: SequenceNotStr[str] | Omit = omit, limit: int | Omit = omit, @@ -263,8 +261,6 @@ def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -327,7 +323,7 @@ def with_streaming_response(self) -> AsyncRegistrarResourceWithStreamingResponse async def check( self, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[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. @@ -406,8 +402,6 @@ async def check( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -426,7 +420,7 @@ async def check( async def search( self, *, - account_id: str | None = None, + account_id: str, q: str, extensions: SequenceNotStr[str] | Omit = omit, limit: int | Omit = omit, @@ -494,8 +488,6 @@ async def search( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/registrar/registration_status.py b/src/cloudflare/resources/registrar/registration_status.py index d386ee60acb..1a7dbe58a03 100644 --- a/src/cloudflare/resources/registrar/registration_status.py +++ b/src/cloudflare/resources/registrar/registration_status.py @@ -47,7 +47,7 @@ def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -114,8 +114,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -161,7 +159,7 @@ async def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -228,8 +226,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: diff --git a/src/cloudflare/resources/registrar/registrations.py b/src/cloudflare/resources/registrar/registrations.py index 48b0db22b7e..5aa90b8cc51 100644 --- a/src/cloudflare/resources/registrar/registrations.py +++ b/src/cloudflare/resources/registrar/registrations.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> RegistrationsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, domain_name: str, auto_renew: bool | Omit = omit, contacts: registration_create_params.Contacts | Omit = omit, @@ -186,8 +186,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})} @@ -216,7 +214,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, per_page: int | Omit = omit, @@ -258,8 +256,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -287,7 +283,7 @@ def edit( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, auto_renew: bool | Omit = omit, prefer: Literal["respond-async"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -332,8 +328,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -363,7 +357,7 @@ def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -395,8 +389,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -441,7 +433,7 @@ def with_streaming_response(self) -> AsyncRegistrationsResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, domain_name: str, auto_renew: bool | Omit = omit, contacts: registration_create_params.Contacts | Omit = omit, @@ -577,8 +569,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Prefer": prefer}), **(extra_headers or {})} @@ -607,7 +597,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, per_page: int | Omit = omit, @@ -649,8 +639,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -678,7 +666,7 @@ async def edit( self, domain_name: str, *, - account_id: str | None = None, + account_id: str, auto_renew: bool | Omit = omit, prefer: Literal["respond-async"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -723,8 +711,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -756,7 +742,7 @@ async def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -788,8 +774,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: diff --git a/src/cloudflare/resources/registrar/update_status.py b/src/cloudflare/resources/registrar/update_status.py index 089c42b4f32..ce5c4670e00 100644 --- a/src/cloudflare/resources/registrar/update_status.py +++ b/src/cloudflare/resources/registrar/update_status.py @@ -47,7 +47,7 @@ def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -84,8 +84,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: @@ -131,7 +129,7 @@ async def get( self, domain_name: str, *, - account_id: str | None = None, + account_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, @@ -168,8 +166,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not domain_name: diff --git a/src/cloudflare/resources/request_tracers/traces.py b/src/cloudflare/resources/request_tracers/traces.py index 1fc474f2e4b..0bbe7430ccc 100644 --- a/src/cloudflare/resources/request_tracers/traces.py +++ b/src/cloudflare/resources/request_tracers/traces.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> TracesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, method: str, url: str, body: trace_create_params.Body | Omit = omit, @@ -91,8 +91,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -144,7 +142,7 @@ def with_streaming_response(self) -> AsyncTracesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, method: str, url: str, body: trace_create_params.Body | Omit = omit, @@ -188,8 +186,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index fedefa77a39..746c817ad7b 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -52,7 +52,7 @@ def create( self, share_id: str, *, - path_account_id: str | None = None, + path_account_id: str, body_account_id: str | Omit = omit, organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if path_account_id is None: - path_account_id = self._client._get_account_id_path_param() if not path_account_id: raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") if not share_id: @@ -116,7 +114,7 @@ def list( self, share_id: str, *, - account_id: str | None = None, + account_id: str, include_resources: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -149,8 +147,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -181,7 +177,7 @@ def delete( self, recipient_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -209,8 +205,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -238,7 +232,7 @@ def get( self, recipient_id: str, *, - account_id: str | None = None, + account_id: str, share_id: str, include_resources: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -268,8 +262,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -321,7 +313,7 @@ async def create( self, share_id: str, *, - path_account_id: str | None = None, + path_account_id: str, body_account_id: str | Omit = omit, organization_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -352,8 +344,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if path_account_id is None: - path_account_id = self._client._get_account_id_path_param() if not path_account_id: raise ValueError(f"Expected a non-empty value for `path_account_id` but received {path_account_id!r}") if not share_id: @@ -385,7 +375,7 @@ def list( self, share_id: str, *, - account_id: str | None = None, + account_id: str, include_resources: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -418,8 +408,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -450,7 +438,7 @@ async def delete( self, recipient_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -478,8 +466,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -507,7 +493,7 @@ async def get( self, recipient_id: str, *, - account_id: str | None = None, + account_id: str, share_id: str, include_resources: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -537,8 +523,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: diff --git a/src/cloudflare/resources/resource_sharing/resource_sharing.py b/src/cloudflare/resources/resource_sharing/resource_sharing.py index 18bdbf9f9b6..fc3a665fd7d 100644 --- a/src/cloudflare/resources/resource_sharing/resource_sharing.py +++ b/src/cloudflare/resources/resource_sharing/resource_sharing.py @@ -82,7 +82,7 @@ def with_streaming_response(self) -> ResourceSharingResourceWithStreamingRespons def create( self, *, - account_id: str | None = None, + account_id: str, name: str, recipients: Iterable[resource_sharing_create_params.Recipient], resources: Iterable[resource_sharing_create_params.Resource], @@ -110,8 +110,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -138,7 +136,7 @@ def update( self, share_id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -166,8 +164,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -188,7 +184,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, include_recipient_counts: bool | Omit = omit, include_resources: bool | Omit = omit, @@ -249,8 +245,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -284,7 +278,7 @@ def delete( self, share_id: str, *, - account_id: str | None = None, + account_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, @@ -309,8 +303,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -331,7 +323,7 @@ def get( self, share_id: str, *, - account_id: str | None = None, + account_id: str, include_recipient_counts: bool | Omit = omit, include_resources: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -361,8 +353,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -418,7 +408,7 @@ def with_streaming_response(self) -> AsyncResourceSharingResourceWithStreamingRe async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, recipients: Iterable[resource_sharing_create_params.Recipient], resources: Iterable[resource_sharing_create_params.Resource], @@ -446,8 +436,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -474,7 +462,7 @@ async def update( self, share_id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -502,8 +490,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -526,7 +512,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, include_recipient_counts: bool | Omit = omit, include_resources: bool | Omit = omit, @@ -587,8 +573,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -622,7 +606,7 @@ async def delete( self, share_id: str, *, - account_id: str | None = None, + account_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, @@ -647,8 +631,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -669,7 +651,7 @@ async def get( self, share_id: str, *, - account_id: str | None = None, + account_id: str, include_recipient_counts: bool | Omit = omit, include_resources: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -699,8 +681,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: diff --git a/src/cloudflare/resources/resource_sharing/resources.py b/src/cloudflare/resources/resource_sharing/resources.py index 894b47d51bf..ba92aa2776f 100644 --- a/src/cloudflare/resources/resource_sharing/resources.py +++ b/src/cloudflare/resources/resource_sharing/resources.py @@ -54,7 +54,7 @@ def create( self, share_id: str, *, - account_id: str | None = None, + account_id: str, meta: object, resource_account_id: str, resource_id: str, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -129,7 +127,7 @@ def update( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_id: str, meta: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,8 +158,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -190,7 +186,7 @@ def list( self, share_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, resource_type: Literal[ @@ -233,8 +229,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -266,7 +260,7 @@ def delete( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -294,8 +288,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -323,7 +315,7 @@ def get( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -350,8 +342,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -400,7 +390,7 @@ async def create( self, share_id: str, *, - account_id: str | None = None, + account_id: str, meta: object, resource_account_id: str, resource_id: str, @@ -442,8 +432,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -475,7 +463,7 @@ async def update( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_id: str, meta: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -506,8 +494,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -536,7 +522,7 @@ def list( self, share_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, resource_type: Literal[ @@ -579,8 +565,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -612,7 +596,7 @@ async def delete( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -640,8 +624,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: @@ -669,7 +651,7 @@ async def get( self, resource_id: str, *, - account_id: str | None = None, + account_id: str, share_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. @@ -696,8 +678,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not share_id: diff --git a/src/cloudflare/resources/resource_tagging/account_tags.py b/src/cloudflare/resources/resource_tagging/account_tags.py index 2038f1dfbc4..8b9a8f40b05 100644 --- a/src/cloudflare/resources/resource_tagging/account_tags.py +++ b/src/cloudflare/resources/resource_tagging/account_tags.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> AccountTagsResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -113,7 +113,7 @@ def update( def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -168,11 +168,13 @@ def update( """ ... - @required_args(["resource_id", "resource_type", "worker_id"], ["resource_id", "resource_type"]) + @required_args( + ["account_id", "resource_id", "resource_type", "worker_id"], ["account_id", "resource_id", "resource_type"] + ) def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -227,8 +229,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountTagUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} @@ -261,7 +261,7 @@ def update( def delete( self, *, - account_id: str | None = None, + account_id: str, if_match: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -284,8 +284,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -301,7 +299,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -353,8 +351,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -407,7 +403,7 @@ def with_streaming_response(self) -> AsyncAccountTagsResourceWithStreamingRespon async def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -470,7 +466,7 @@ async def update( async def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -525,11 +521,13 @@ async def update( """ ... - @required_args(["resource_id", "resource_type", "worker_id"], ["resource_id", "resource_type"]) + @required_args( + ["account_id", "resource_id", "resource_type", "worker_id"], ["account_id", "resource_id", "resource_type"] + ) async def update( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -584,8 +582,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AccountTagUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} @@ -618,7 +614,7 @@ async def update( async def delete( self, *, - account_id: str | None = None, + account_id: str, if_match: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -641,8 +637,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -658,7 +652,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_id: str, resource_id: str, resource_type: Literal[ "access_application", @@ -710,8 +704,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( diff --git a/src/cloudflare/resources/resource_tagging/keys.py b/src/cloudflare/resources/resource_tagging/keys.py index 9cb2f316cf7..14a6dfb6d49 100644 --- a/src/cloudflare/resources/resource_tagging/keys.py +++ b/src/cloudflare/resources/resource_tagging/keys.py @@ -45,7 +45,7 @@ def with_streaming_response(self) -> KeysResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -111,7 +109,7 @@ def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/resource_tagging/resource_tagging.py b/src/cloudflare/resources/resource_tagging/resource_tagging.py index 7cbdfbf5683..2de31bd301d 100644 --- a/src/cloudflare/resources/resource_tagging/resource_tagging.py +++ b/src/cloudflare/resources/resource_tagging/resource_tagging.py @@ -96,7 +96,7 @@ def with_streaming_response(self) -> ResourceTaggingResourceWithStreamingRespons def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, tag: SequenceNotStr[str] | Omit = omit, type: List[ @@ -175,8 +175,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -241,7 +239,7 @@ def with_streaming_response(self) -> AsyncResourceTaggingResourceWithStreamingRe def list( self, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, tag: SequenceNotStr[str] | Omit = omit, type: List[ @@ -320,8 +318,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/resource_tagging/values.py b/src/cloudflare/resources/resource_tagging/values.py index 94b2e260534..115c1437d24 100644 --- a/src/cloudflare/resources/resource_tagging/values.py +++ b/src/cloudflare/resources/resource_tagging/values.py @@ -48,7 +48,7 @@ def list( self, tag_key: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, type: Literal[ "access_application", @@ -106,8 +106,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_key: @@ -156,7 +154,7 @@ def list( self, tag_key: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, type: Literal[ "access_application", @@ -214,8 +212,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_key: diff --git a/src/cloudflare/resources/resource_tagging/zone_tags.py b/src/cloudflare/resources/resource_tagging/zone_tags.py index 1b02c0f38ea..5796eb0b8b4 100644 --- a/src/cloudflare/resources/resource_tagging/zone_tags.py +++ b/src/cloudflare/resources/resource_tagging/zone_tags.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> ZoneTagsResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "api_gateway_operation", @@ -97,7 +97,7 @@ def update( def update( self, *, - zone_id: str | None = None, + zone_id: str, access_application_id: str, resource_id: str, resource_type: Literal[ @@ -144,11 +144,14 @@ def update( """ ... - @required_args(["resource_id", "resource_type"], ["access_application_id", "resource_id", "resource_type"]) + @required_args( + ["zone_id", "resource_id", "resource_type"], + ["zone_id", "access_application_id", "resource_id", "resource_type"], + ) def update( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "api_gateway_operation", @@ -177,8 +180,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneTagUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} @@ -211,7 +212,7 @@ def update( def delete( self, *, - zone_id: str | None = None, + zone_id: str, if_match: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -234,8 +235,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -251,7 +250,7 @@ def delete( def get( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "access_application_policy", @@ -291,8 +290,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -345,7 +342,7 @@ def with_streaming_response(self) -> AsyncZoneTagsResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "api_gateway_operation", @@ -392,7 +389,7 @@ async def update( async def update( self, *, - zone_id: str | None = None, + zone_id: str, access_application_id: str, resource_id: str, resource_type: Literal[ @@ -439,11 +436,14 @@ async def update( """ ... - @required_args(["resource_id", "resource_type"], ["access_application_id", "resource_id", "resource_type"]) + @required_args( + ["zone_id", "resource_id", "resource_type"], + ["zone_id", "access_application_id", "resource_id", "resource_type"], + ) async def update( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "api_gateway_operation", @@ -472,8 +472,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneTagUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} @@ -506,7 +504,7 @@ async def update( async def delete( self, *, - zone_id: str | None = None, + zone_id: str, if_match: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -529,8 +527,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -546,7 +542,7 @@ async def delete( async def get( self, *, - zone_id: str | None = None, + zone_id: str, resource_id: str, resource_type: Literal[ "access_application_policy", @@ -586,8 +582,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( diff --git a/src/cloudflare/resources/rules/lists/bulk_operations.py b/src/cloudflare/resources/rules/lists/bulk_operations.py index 60fe6e088d4..83133e8c629 100644 --- a/src/cloudflare/resources/rules/lists/bulk_operations.py +++ b/src/cloudflare/resources/rules/lists/bulk_operations.py @@ -47,7 +47,7 @@ def get( self, operation_id: str, *, - account_id: str | None = None, + account_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, @@ -75,8 +75,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not operation_id: @@ -127,7 +125,7 @@ async def get( self, operation_id: str, *, - account_id: str | None = None, + account_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, @@ -155,8 +153,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not operation_id: diff --git a/src/cloudflare/resources/rules/lists/items.py b/src/cloudflare/resources/rules/lists/items.py index dfa11d97ca4..742f6a3a0a8 100644 --- a/src/cloudflare/resources/rules/lists/items.py +++ b/src/cloudflare/resources/rules/lists/items.py @@ -53,7 +53,7 @@ def create( self, list_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[item_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -85,8 +85,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -108,7 +106,7 @@ def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[item_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -140,8 +138,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -163,7 +159,7 @@ def list( self, list_id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -203,8 +199,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -233,7 +227,7 @@ def delete( self, list_id: str, *, - account_id: str | None = None, + account_id: str, items: Iterable[item_delete_params.Item] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -265,8 +259,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -288,7 +280,7 @@ def get( self, item_id: str, *, - account_id: str | None = None, + account_id: str, list_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. @@ -315,8 +307,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -370,7 +360,7 @@ async def create( self, list_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[item_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -402,8 +392,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -425,7 +413,7 @@ async def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[item_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -457,8 +445,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -480,7 +466,7 @@ def list( self, list_id: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -520,8 +506,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -550,7 +534,7 @@ async def delete( self, list_id: str, *, - account_id: str | None = None, + account_id: str, items: Iterable[item_delete_params.Item] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -582,8 +566,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -605,7 +587,7 @@ async def get( self, item_id: str, *, - account_id: str | None = None, + account_id: str, list_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. @@ -632,8 +614,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: diff --git a/src/cloudflare/resources/rules/lists/lists.py b/src/cloudflare/resources/rules/lists/lists.py index f3e00b8f378..82049d188e1 100644 --- a/src/cloudflare/resources/rules/lists/lists.py +++ b/src/cloudflare/resources/rules/lists/lists.py @@ -77,7 +77,7 @@ def with_streaming_response(self) -> ListsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["ip", "redirect", "hostname", "asn"], name: str, description: str | Omit = omit, @@ -109,8 +109,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -137,7 +135,7 @@ def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -164,8 +162,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -186,7 +182,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -208,8 +204,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -225,7 +219,7 @@ def delete( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -249,8 +243,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -271,7 +263,7 @@ def get( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -295,8 +287,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -345,7 +335,7 @@ def with_streaming_response(self) -> AsyncListsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["ip", "redirect", "hostname", "asn"], name: str, description: str | Omit = omit, @@ -377,8 +367,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -405,7 +393,7 @@ async def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -432,8 +420,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -454,7 +440,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -476,8 +462,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -493,7 +477,7 @@ async def delete( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -517,8 +501,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -539,7 +521,7 @@ async def get( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -563,8 +545,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: diff --git a/src/cloudflare/resources/rulesets/phases/phases.py b/src/cloudflare/resources/rulesets/phases/phases.py index 0bf0455ba5b..2ccd029b84a 100644 --- a/src/cloudflare/resources/rulesets/phases/phases.py +++ b/src/cloudflare/resources/rulesets/phases/phases.py @@ -62,8 +62,8 @@ def update( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, name: str | Omit = omit, rules: Iterable[phase_update_params.Rule] | Omit = omit, @@ -100,10 +100,6 @@ def update( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -145,8 +141,8 @@ def get( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -175,10 +171,6 @@ def get( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -237,8 +229,8 @@ async def update( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, name: str | Omit = omit, rules: Iterable[phase_update_params.Rule] | Omit = omit, @@ -275,10 +267,6 @@ async def update( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -320,8 +308,8 @@ async def get( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -350,10 +338,6 @@ async def get( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/rulesets/phases/versions.py b/src/cloudflare/resources/rulesets/phases/versions.py index 1e5109c9027..3a9038913e8 100644 --- a/src/cloudflare/resources/rulesets/phases/versions.py +++ b/src/cloudflare/resources/rulesets/phases/versions.py @@ -6,7 +6,7 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import path_template from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -51,8 +51,8 @@ def list( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -80,10 +80,6 @@ def list( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -115,8 +111,8 @@ def get( ruleset_version: str, *, ruleset_phase: Phase, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -148,10 +144,6 @@ def get( raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -207,8 +199,8 @@ def list( self, ruleset_phase: Phase, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -236,10 +228,6 @@ def list( """ if not ruleset_phase: raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -271,8 +259,8 @@ async def get( ruleset_version: str, *, ruleset_phase: Phase, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -304,10 +292,6 @@ async def get( raise ValueError(f"Expected a non-empty value for `ruleset_phase` but received {ruleset_phase!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index 8dd53abab70..8b06a82a0d3 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -53,8 +53,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Omit = omit, action_parameters: rule_create_params.BlockRuleActionParameters | Omit = omit, @@ -122,8 +122,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -191,8 +191,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["compress_response"] | Omit = omit, action_parameters: rule_create_params.ResponseCompressionRuleActionParameters | Omit = omit, @@ -260,8 +260,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["ddos_dynamic"] | Omit = omit, action_parameters: object | Omit = omit, @@ -329,8 +329,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["execute"] | Omit = omit, action_parameters: rule_create_params.ExecuteRuleActionParameters | Omit = omit, @@ -398,8 +398,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["force_connection_close"] | Omit = omit, action_parameters: object | Omit = omit, @@ -467,8 +467,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["js_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -536,8 +536,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log"] | Omit = omit, action_parameters: object | Omit = omit, @@ -605,8 +605,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log_custom_field"] | Omit = omit, action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | Omit = omit, @@ -674,8 +674,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["managed_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -743,8 +743,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["redirect"] | Omit = omit, action_parameters: rule_create_params.RedirectRuleActionParameters | Omit = omit, @@ -812,8 +812,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["rewrite"] | Omit = omit, action_parameters: rule_create_params.RewriteRuleActionParameters | Omit = omit, @@ -881,8 +881,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["route"] | Omit = omit, action_parameters: rule_create_params.RouteRuleActionParameters | Omit = omit, @@ -950,8 +950,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["score"] | Omit = omit, action_parameters: rule_create_params.ScoreRuleActionParameters | Omit = omit, @@ -1019,8 +1019,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["serve_error"] | Omit = omit, action_parameters: rule_create_params.ServeErrorRuleActionParameters | Omit = omit, @@ -1088,8 +1088,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_control"] | Omit = omit, action_parameters: rule_create_params.SetCacheControlRuleActionParameters | Omit = omit, @@ -1157,8 +1157,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_settings"] | Omit = omit, action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | Omit = omit, @@ -1226,8 +1226,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_tags"] | Omit = omit, action_parameters: rule_create_params.SetCacheTagsRuleActionParameters | Omit = omit, @@ -1295,8 +1295,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_config"] | Omit = omit, action_parameters: rule_create_params.SetConfigurationRuleActionParameters | Omit = omit, @@ -1364,8 +1364,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["skip"] | Omit = omit, action_parameters: rule_create_params.SkipRuleActionParameters | Omit = omit, @@ -1432,8 +1432,8 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] @@ -1549,10 +1549,6 @@ def create( ) -> RuleCreateResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1603,8 +1599,8 @@ def delete( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1636,10 +1632,6 @@ def delete( 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 account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1676,8 +1668,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Omit = omit, action_parameters: rule_edit_params.BlockRuleActionParameters | Omit = omit, @@ -1746,8 +1738,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -1816,8 +1808,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["compress_response"] | Omit = omit, action_parameters: rule_edit_params.ResponseCompressionRuleActionParameters | Omit = omit, @@ -1886,8 +1878,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["ddos_dynamic"] | Omit = omit, action_parameters: object | Omit = omit, @@ -1956,8 +1948,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["execute"] | Omit = omit, action_parameters: rule_edit_params.ExecuteRuleActionParameters | Omit = omit, @@ -2026,8 +2018,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["force_connection_close"] | Omit = omit, action_parameters: object | Omit = omit, @@ -2096,8 +2088,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["js_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -2166,8 +2158,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log"] | Omit = omit, action_parameters: object | Omit = omit, @@ -2236,8 +2228,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log_custom_field"] | Omit = omit, action_parameters: rule_edit_params.LogCustomFieldRuleActionParameters | Omit = omit, @@ -2306,8 +2298,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["managed_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -2376,8 +2368,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["redirect"] | Omit = omit, action_parameters: rule_edit_params.RedirectRuleActionParameters | Omit = omit, @@ -2446,8 +2438,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["rewrite"] | Omit = omit, action_parameters: rule_edit_params.RewriteRuleActionParameters | Omit = omit, @@ -2516,8 +2508,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["route"] | Omit = omit, action_parameters: rule_edit_params.RouteRuleActionParameters | Omit = omit, @@ -2586,8 +2578,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["score"] | Omit = omit, action_parameters: rule_edit_params.ScoreRuleActionParameters | Omit = omit, @@ -2656,8 +2648,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["serve_error"] | Omit = omit, action_parameters: rule_edit_params.ServeErrorRuleActionParameters | Omit = omit, @@ -2726,8 +2718,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_control"] | Omit = omit, action_parameters: rule_edit_params.SetCacheControlRuleActionParameters | Omit = omit, @@ -2796,8 +2788,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_settings"] | Omit = omit, action_parameters: rule_edit_params.SetCacheSettingsRuleActionParameters | Omit = omit, @@ -2866,8 +2858,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_tags"] | Omit = omit, action_parameters: rule_edit_params.SetCacheTagsRuleActionParameters | Omit = omit, @@ -2936,8 +2928,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_config"] | Omit = omit, action_parameters: rule_edit_params.SetConfigurationRuleActionParameters | Omit = omit, @@ -3006,8 +2998,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["skip"] | Omit = omit, action_parameters: rule_edit_params.SkipRuleActionParameters | Omit = omit, @@ -3076,8 +3068,8 @@ def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] @@ -3195,10 +3187,6 @@ def edit( 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 account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3271,8 +3259,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Omit = omit, action_parameters: rule_create_params.BlockRuleActionParameters | Omit = omit, @@ -3340,8 +3328,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3409,8 +3397,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["compress_response"] | Omit = omit, action_parameters: rule_create_params.ResponseCompressionRuleActionParameters | Omit = omit, @@ -3478,8 +3466,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["ddos_dynamic"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3547,8 +3535,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["execute"] | Omit = omit, action_parameters: rule_create_params.ExecuteRuleActionParameters | Omit = omit, @@ -3616,8 +3604,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["force_connection_close"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3685,8 +3673,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["js_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3754,8 +3742,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3823,8 +3811,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log_custom_field"] | Omit = omit, action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | Omit = omit, @@ -3892,8 +3880,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["managed_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -3961,8 +3949,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["redirect"] | Omit = omit, action_parameters: rule_create_params.RedirectRuleActionParameters | Omit = omit, @@ -4030,8 +4018,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["rewrite"] | Omit = omit, action_parameters: rule_create_params.RewriteRuleActionParameters | Omit = omit, @@ -4099,8 +4087,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["route"] | Omit = omit, action_parameters: rule_create_params.RouteRuleActionParameters | Omit = omit, @@ -4168,8 +4156,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["score"] | Omit = omit, action_parameters: rule_create_params.ScoreRuleActionParameters | Omit = omit, @@ -4237,8 +4225,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["serve_error"] | Omit = omit, action_parameters: rule_create_params.ServeErrorRuleActionParameters | Omit = omit, @@ -4306,8 +4294,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_control"] | Omit = omit, action_parameters: rule_create_params.SetCacheControlRuleActionParameters | Omit = omit, @@ -4375,8 +4363,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_settings"] | Omit = omit, action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | Omit = omit, @@ -4444,8 +4432,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_tags"] | Omit = omit, action_parameters: rule_create_params.SetCacheTagsRuleActionParameters | Omit = omit, @@ -4513,8 +4501,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_config"] | Omit = omit, action_parameters: rule_create_params.SetConfigurationRuleActionParameters | Omit = omit, @@ -4582,8 +4570,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["skip"] | Omit = omit, action_parameters: rule_create_params.SkipRuleActionParameters | Omit = omit, @@ -4650,8 +4638,8 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] @@ -4767,10 +4755,6 @@ async def create( ) -> RuleCreateResponse: if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -4821,8 +4805,8 @@ async def delete( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -4854,10 +4838,6 @@ async def delete( 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 account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -4894,8 +4874,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Omit = omit, action_parameters: rule_edit_params.BlockRuleActionParameters | Omit = omit, @@ -4964,8 +4944,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5034,8 +5014,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["compress_response"] | Omit = omit, action_parameters: rule_edit_params.ResponseCompressionRuleActionParameters | Omit = omit, @@ -5104,8 +5084,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["ddos_dynamic"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5174,8 +5154,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["execute"] | Omit = omit, action_parameters: rule_edit_params.ExecuteRuleActionParameters | Omit = omit, @@ -5244,8 +5224,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["force_connection_close"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5314,8 +5294,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["js_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5384,8 +5364,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5454,8 +5434,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["log_custom_field"] | Omit = omit, action_parameters: rule_edit_params.LogCustomFieldRuleActionParameters | Omit = omit, @@ -5524,8 +5504,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["managed_challenge"] | Omit = omit, action_parameters: object | Omit = omit, @@ -5594,8 +5574,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["redirect"] | Omit = omit, action_parameters: rule_edit_params.RedirectRuleActionParameters | Omit = omit, @@ -5664,8 +5644,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["rewrite"] | Omit = omit, action_parameters: rule_edit_params.RewriteRuleActionParameters | Omit = omit, @@ -5734,8 +5714,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["route"] | Omit = omit, action_parameters: rule_edit_params.RouteRuleActionParameters | Omit = omit, @@ -5804,8 +5784,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["score"] | Omit = omit, action_parameters: rule_edit_params.ScoreRuleActionParameters | Omit = omit, @@ -5874,8 +5854,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["serve_error"] | Omit = omit, action_parameters: rule_edit_params.ServeErrorRuleActionParameters | Omit = omit, @@ -5944,8 +5924,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_control"] | Omit = omit, action_parameters: rule_edit_params.SetCacheControlRuleActionParameters | Omit = omit, @@ -6014,8 +5994,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_settings"] | Omit = omit, action_parameters: rule_edit_params.SetCacheSettingsRuleActionParameters | Omit = omit, @@ -6084,8 +6064,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_cache_tags"] | Omit = omit, action_parameters: rule_edit_params.SetCacheTagsRuleActionParameters | Omit = omit, @@ -6154,8 +6134,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["set_config"] | Omit = omit, action_parameters: rule_edit_params.SetConfigurationRuleActionParameters | Omit = omit, @@ -6224,8 +6204,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["skip"] | Omit = omit, action_parameters: rule_edit_params.SkipRuleActionParameters | Omit = omit, @@ -6294,8 +6274,8 @@ async def edit( rule_id: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, id: str | Omit = omit, action: Literal["block"] | Literal["challenge"] @@ -6413,10 +6393,6 @@ async def edit( 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 account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index 9f35e97ba41..157347dfa2d 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -92,8 +92,8 @@ def create( kind: Kind, name: str, phase: Phase, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, rules: Iterable[ruleset_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -129,10 +129,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -175,8 +171,8 @@ def update( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, kind: Kind | Omit = omit, name: str | Omit = omit, @@ -219,10 +215,6 @@ def update( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -265,8 +257,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, cursor: str | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -296,10 +288,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -339,8 +327,8 @@ def delete( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -368,10 +356,6 @@ def delete( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -402,8 +386,8 @@ def get( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -431,10 +415,6 @@ def get( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -503,8 +483,8 @@ async def create( kind: Kind, name: str, phase: Phase, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, rules: Iterable[ruleset_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -540,10 +520,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -586,8 +562,8 @@ async def update( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, description: str | Omit = omit, kind: Kind | Omit = omit, name: str | Omit = omit, @@ -630,10 +606,6 @@ async def update( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -676,8 +648,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, cursor: str | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -707,10 +679,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -750,8 +718,8 @@ async def delete( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -779,10 +747,6 @@ async def delete( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -813,8 +777,8 @@ async def get( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -842,10 +806,6 @@ async def get( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/rulesets/versions.py b/src/cloudflare/resources/rulesets/versions.py index d3833f2fe66..ad6cb5e4efd 100644 --- a/src/cloudflare/resources/rulesets/versions.py +++ b/src/cloudflare/resources/rulesets/versions.py @@ -6,7 +6,7 @@ import httpx -from ..._types import Body, Query, Headers, NoneType, NotGiven, not_given +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import path_template from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -49,8 +49,8 @@ def list( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,10 +78,6 @@ def list( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -113,8 +109,8 @@ def delete( ruleset_version: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -146,10 +142,6 @@ def delete( raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -182,8 +174,8 @@ def get( ruleset_version: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -215,10 +207,6 @@ def get( raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -274,8 +262,8 @@ def list( self, ruleset_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -303,10 +291,6 @@ def list( """ if not ruleset_id: raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -338,8 +322,8 @@ async def delete( ruleset_version: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -371,10 +355,6 @@ async def delete( raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -407,8 +387,8 @@ async def get( ruleset_version: str, *, ruleset_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -440,10 +420,6 @@ async def get( raise ValueError(f"Expected a non-empty value for `ruleset_id` but received {ruleset_id!r}") if not ruleset_version: raise ValueError(f"Expected a non-empty value for `ruleset_version` but received {ruleset_version!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/rum/rules.py b/src/cloudflare/resources/rum/rules.py index 7d2975dd554..e33f7cbdcdd 100644 --- a/src/cloudflare/resources/rum/rules.py +++ b/src/cloudflare/resources/rum/rules.py @@ -51,7 +51,7 @@ def create( self, ruleset_id: str, *, - account_id: str | None = None, + account_id: str, host: str | Omit = omit, inclusive: bool | Omit = omit, is_paused: bool | Omit = omit, @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -116,7 +114,7 @@ def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, ruleset_id: str, host: str | Omit = omit, inclusive: bool | Omit = omit, @@ -151,8 +149,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -189,7 +185,7 @@ def list( self, ruleset_id: str, *, - account_id: str | None = None, + account_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, @@ -213,8 +209,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -237,7 +231,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, ruleset_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. @@ -264,8 +258,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -293,7 +285,7 @@ def bulk_create( self, ruleset_id: str, *, - account_id: str | None = None, + account_id: str, delete_rules: SequenceNotStr[str] | Omit = omit, rules: Iterable[rule_bulk_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -323,8 +315,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -375,7 +365,7 @@ async def create( self, ruleset_id: str, *, - account_id: str | None = None, + account_id: str, host: str | Omit = omit, inclusive: bool | Omit = omit, is_paused: bool | Omit = omit, @@ -407,8 +397,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -440,7 +428,7 @@ async def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, ruleset_id: str, host: str | Omit = omit, inclusive: bool | Omit = omit, @@ -475,8 +463,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -513,7 +499,7 @@ async def list( self, ruleset_id: str, *, - account_id: str | None = None, + account_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, @@ -537,8 +523,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -561,7 +545,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, ruleset_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. @@ -588,8 +572,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: @@ -617,7 +599,7 @@ async def bulk_create( self, ruleset_id: str, *, - account_id: str | None = None, + account_id: str, delete_rules: SequenceNotStr[str] | Omit = omit, rules: Iterable[rule_bulk_create_params.Rule] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -647,8 +629,6 @@ async def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ruleset_id: diff --git a/src/cloudflare/resources/rum/site_info.py b/src/cloudflare/resources/rum/site_info.py index 84cb9b95fd6..bfa063f0aa9 100644 --- a/src/cloudflare/resources/rum/site_info.py +++ b/src/cloudflare/resources/rum/site_info.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> SiteInfoResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, auto_install: bool | Omit = omit, host: str | Omit = omit, zone_tag: str | Omit = omit, @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -110,7 +108,7 @@ def update( self, site_id: str, *, - account_id: str | None = None, + account_id: str, auto_install: bool | Omit = omit, enabled: bool | Omit = omit, host: str | Omit = omit, @@ -152,8 +150,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -183,7 +179,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, order_by: Literal["host", "created"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -214,8 +210,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -242,7 +236,7 @@ def delete( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -266,8 +260,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -288,7 +280,7 @@ def get( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -312,8 +304,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -354,7 +344,7 @@ def with_streaming_response(self) -> AsyncSiteInfoResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, auto_install: bool | Omit = omit, host: str | Omit = omit, zone_tag: str | Omit = omit, @@ -386,8 +376,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -414,7 +402,7 @@ async def update( self, site_id: str, *, - account_id: str | None = None, + account_id: str, auto_install: bool | Omit = omit, enabled: bool | Omit = omit, host: str | Omit = omit, @@ -456,8 +444,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -487,7 +473,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, order_by: Literal["host", "created"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -518,8 +504,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -546,7 +530,7 @@ async def delete( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -570,8 +554,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: @@ -592,7 +574,7 @@ async def get( self, site_id: str, *, - account_id: str | None = None, + account_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, @@ -616,8 +598,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not site_id: diff --git a/src/cloudflare/resources/schema_validation/schemas.py b/src/cloudflare/resources/schema_validation/schemas.py index 704927a03b9..3a034655b5d 100644 --- a/src/cloudflare/resources/schema_validation/schemas.py +++ b/src/cloudflare/resources/schema_validation/schemas.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> SchemasResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, kind: Literal["openapi_v3"], name: str, source: str, @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -114,7 +112,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -148,8 +146,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -177,7 +173,7 @@ def delete( self, schema_id: str, *, - zone_id: str | None = None, + 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, @@ -203,8 +199,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -227,7 +221,7 @@ def edit( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -255,8 +249,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -280,7 +272,7 @@ def get( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -308,8 +300,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -353,7 +343,7 @@ def with_streaming_response(self) -> AsyncSchemasResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, kind: Literal["openapi_v3"], name: str, source: str, @@ -389,8 +379,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -417,7 +405,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -451,8 +439,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -480,7 +466,7 @@ async def delete( self, schema_id: str, *, - zone_id: str | None = None, + 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, @@ -506,8 +492,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -530,7 +514,7 @@ async def edit( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -558,8 +542,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: @@ -585,7 +567,7 @@ async def get( self, schema_id: str, *, - zone_id: str | None = None, + zone_id: str, omit_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -613,8 +595,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not schema_id: diff --git a/src/cloudflare/resources/schema_validation/settings/operations.py b/src/cloudflare/resources/schema_validation/settings/operations.py index 36a6d67922b..473df54ff1b 100644 --- a/src/cloudflare/resources/schema_validation/settings/operations.py +++ b/src/cloudflare/resources/schema_validation/settings/operations.py @@ -58,7 +58,7 @@ def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, mitigation_action: Optional[Literal["log", "block", "none"]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -92,8 +92,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -120,7 +118,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -148,8 +146,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -175,7 +171,7 @@ def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -200,8 +196,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -225,7 +219,7 @@ def delete( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Dict[str, operation_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -249,8 +243,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -270,7 +262,7 @@ def get( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -295,8 +287,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -342,7 +332,7 @@ async def update( self, operation_id: str, *, - zone_id: str | None = None, + zone_id: str, mitigation_action: Optional[Literal["log", "block", "none"]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -376,8 +366,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -404,7 +392,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -432,8 +420,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -459,7 +445,7 @@ async def delete( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -484,8 +470,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: @@ -509,7 +493,7 @@ async def delete( async def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Dict[str, operation_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -533,8 +517,6 @@ async def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -554,7 +536,7 @@ async def get( self, operation_id: str, *, - zone_id: str | None = None, + 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, @@ -579,8 +561,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not operation_id: diff --git a/src/cloudflare/resources/schema_validation/settings/settings.py b/src/cloudflare/resources/schema_validation/settings/settings.py index ac44cf14e98..58815528896 100644 --- a/src/cloudflare/resources/schema_validation/settings/settings.py +++ b/src/cloudflare/resources/schema_validation/settings/settings.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], validation_override_mitigation_action: Optional[Literal["none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -99,8 +99,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -125,7 +123,7 @@ def update( def edit( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"] | Omit = omit, validation_override_mitigation_action: Optional[Literal["none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -162,8 +160,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -188,7 +184,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -210,8 +206,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -254,7 +248,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"], validation_override_mitigation_action: Optional[Literal["none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -291,8 +285,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -317,7 +309,7 @@ async def update( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, validation_default_mitigation_action: Literal["none", "log", "block"] | Omit = omit, validation_override_mitigation_action: Optional[Literal["none"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -354,8 +346,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -380,7 +370,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -402,8 +392,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/secrets_store/quota.py b/src/cloudflare/resources/secrets_store/quota.py index a513d4791f2..f3095b0863f 100644 --- a/src/cloudflare/resources/secrets_store/quota.py +++ b/src/cloudflare/resources/secrets_store/quota.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> QuotaResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncQuotaResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/secrets_store/stores/secrets.py b/src/cloudflare/resources/secrets_store/stores/secrets.py index 4e1b470eb45..6ee2aae5e08 100644 --- a/src/cloudflare/resources/secrets_store/stores/secrets.py +++ b/src/cloudflare/resources/secrets_store/stores/secrets.py @@ -59,7 +59,7 @@ def create( self, store_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[secret_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -109,7 +107,7 @@ def list( self, store_id: str, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, page: int | Omit = omit, @@ -151,8 +149,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -188,7 +184,7 @@ def delete( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_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. @@ -215,8 +211,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -244,7 +238,7 @@ def bulk_delete( self, store_id: str, *, - account_id: str | None = None, + account_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, @@ -268,8 +262,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -294,7 +286,7 @@ def duplicate( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_id: str, name: str, scopes: SequenceNotStr[str], @@ -330,8 +322,6 @@ def duplicate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -367,7 +357,7 @@ def edit( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_id: str, comment: str | Omit = omit, scopes: SequenceNotStr[str] | Omit = omit, @@ -393,8 +383,9 @@ def edit( scopes: The list of services that can use this secret. - value: The value of the secret. Note that this is 'write only' - no API reponse will - provide this value, it is only used to create/modify secrets. + value: The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write + only' - no API response will provide this value, it is only used to + create/modify secrets. extra_headers: Send extra headers @@ -404,8 +395,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -441,7 +430,7 @@ def get( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_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. @@ -468,8 +457,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -518,7 +505,7 @@ def create( self, store_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[secret_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -543,8 +530,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -568,7 +553,7 @@ def list( self, store_id: str, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, page: int | Omit = omit, @@ -610,8 +595,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -647,7 +630,7 @@ async def delete( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_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. @@ -674,8 +657,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -703,7 +684,7 @@ async def bulk_delete( self, store_id: str, *, - account_id: str | None = None, + account_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, @@ -727,8 +708,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -753,7 +732,7 @@ async def duplicate( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_id: str, name: str, scopes: SequenceNotStr[str], @@ -789,8 +768,6 @@ async def duplicate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -826,7 +803,7 @@ async def edit( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_id: str, comment: str | Omit = omit, scopes: SequenceNotStr[str] | Omit = omit, @@ -852,8 +829,9 @@ async def edit( scopes: The list of services that can use this secret. - value: The value of the secret. Note that this is 'write only' - no API reponse will - provide this value, it is only used to create/modify secrets. + value: The value of the secret. Maximum 64 KiB (65,536 bytes). Note that this is 'write + only' - no API response will provide this value, it is only used to + create/modify secrets. extra_headers: Send extra headers @@ -863,8 +841,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -900,7 +876,7 @@ async def get( self, secret_id: str, *, - account_id: str | None = None, + account_id: str, store_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. @@ -927,8 +903,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: diff --git a/src/cloudflare/resources/secrets_store/stores/stores.py b/src/cloudflare/resources/secrets_store/stores/stores.py index 2e4edb25523..a678164cee9 100644 --- a/src/cloudflare/resources/secrets_store/stores/stores.py +++ b/src/cloudflare/resources/secrets_store/stores/stores.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> StoresResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -87,8 +87,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, page: int | Omit = omit, @@ -141,8 +139,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -170,7 +166,7 @@ def delete( self, store_id: str, *, - account_id: str | None = None, + account_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, @@ -194,8 +190,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: @@ -242,7 +236,7 @@ def with_streaming_response(self) -> AsyncStoresResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -267,8 +261,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -287,7 +279,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["name", "comment", "created", "modified", "status"] | Omit = omit, page: int | Omit = omit, @@ -321,8 +313,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -350,7 +340,7 @@ async def delete( self, store_id: str, *, - account_id: str | None = None, + account_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, @@ -374,8 +364,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not store_id: diff --git a/src/cloudflare/resources/security_center/insights/class_.py b/src/cloudflare/resources/security_center/insights/class_.py index 5d039a45e65..52f0b25ff75 100644 --- a/src/cloudflare/resources/security_center/insights/class_.py +++ b/src/cloudflare/resources/security_center/insights/class_.py @@ -49,8 +49,8 @@ def with_streaming_response(self) -> ClassResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -85,10 +85,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -157,8 +153,8 @@ def with_streaming_response(self) -> AsyncClassResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -193,10 +189,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/security_center/insights/insights.py b/src/cloudflare/resources/security_center/insights/insights.py index eb8fc46185e..8ccae5088ef 100644 --- a/src/cloudflare/resources/security_center/insights/insights.py +++ b/src/cloudflare/resources/security_center/insights/insights.py @@ -86,8 +86,8 @@ def with_streaming_response(self) -> InsightsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -129,10 +129,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -183,8 +179,8 @@ def dismiss( self, issue_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismiss: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -212,10 +208,6 @@ def dismiss( """ if not issue_id: raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -278,8 +270,8 @@ def with_streaming_response(self) -> AsyncInsightsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -321,10 +313,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -375,8 +363,8 @@ async def dismiss( self, issue_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismiss: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -404,10 +392,6 @@ async def dismiss( """ if not issue_id: raise ValueError(f"Expected a non-empty value for `issue_id` but received {issue_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/security_center/insights/severity.py b/src/cloudflare/resources/security_center/insights/severity.py index 90efbec1e05..5ef59aca521 100644 --- a/src/cloudflare/resources/security_center/insights/severity.py +++ b/src/cloudflare/resources/security_center/insights/severity.py @@ -49,8 +49,8 @@ def with_streaming_response(self) -> SeverityResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -86,10 +86,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -158,8 +154,8 @@ def with_streaming_response(self) -> AsyncSeverityResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -195,10 +191,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/security_center/insights/type.py b/src/cloudflare/resources/security_center/insights/type.py index d0f57e82b84..73d9d23547e 100644 --- a/src/cloudflare/resources/security_center/insights/type.py +++ b/src/cloudflare/resources/security_center/insights/type.py @@ -49,8 +49,8 @@ def with_streaming_response(self) -> TypeResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -85,10 +85,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -157,8 +153,8 @@ def with_streaming_response(self) -> AsyncTypeResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, dismissed: bool | Omit = omit, issue_class: SequenceNotStr[str] | Omit = omit, issue_class_neq: SequenceNotStr[str] | Omit = omit, @@ -193,10 +189,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/security_txt.py b/src/cloudflare/resources/security_txt.py deleted file mode 100644 index 21df4368570..00000000000 --- a/src/cloudflare/resources/security_txt.py +++ /dev/null @@ -1,401 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Union, Optional, cast -from datetime import datetime - -import httpx - -from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.security_txt import security_txt_update_params -from ..types.security_txt.security_txt_get_response import SecurityTXTGetResponse -from ..types.security_txt.security_txt_delete_response import SecurityTXTDeleteResponse -from ..types.security_txt.security_txt_update_response import SecurityTXTUpdateResponse - -__all__ = ["SecurityTXTResource", "AsyncSecurityTXTResource"] - - -class SecurityTXTResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> SecurityTXTResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return SecurityTXTResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> SecurityTXTResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return SecurityTXTResourceWithStreamingResponse(self) - - def update( - self, - *, - zone_id: str, - acknowledgments: SequenceNotStr[str] | Omit = omit, - canonical: SequenceNotStr[str] | Omit = omit, - contact: SequenceNotStr[str] | Omit = omit, - enabled: bool | Omit = omit, - encryption: SequenceNotStr[str] | Omit = omit, - expires: Union[str, datetime] | Omit = omit, - hiring: SequenceNotStr[str] | Omit = omit, - policy: SequenceNotStr[str] | Omit = omit, - preferred_languages: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SecurityTXTUpdateResponse: - """ - Updates the security.txt file configuration for a zone, which provides security - researchers with vulnerability reporting 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}") - return self._put( - f"/zones/{zone_id}/security-center/securitytxt", - body=maybe_transform( - { - "acknowledgments": acknowledgments, - "canonical": canonical, - "contact": contact, - "enabled": enabled, - "encryption": encryption, - "expires": expires, - "hiring": hiring, - "policy": policy, - "preferred_languages": preferred_languages, - }, - security_txt_update_params.SecurityTXTUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SecurityTXTUpdateResponse, - ) - - def delete( - 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, - ) -> SecurityTXTDeleteResponse: - """Removes the security.txt file configuration for a zone. - - The - /.well-known/security.txt endpoint will no longer be served. - - 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._delete( - f"/zones/{zone_id}/security-center/securitytxt", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SecurityTXTDeleteResponse, - ) - - def get( - 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, - ) -> Optional[SecurityTXTGetResponse]: - """ - Retrieves the current security.txt file configuration for a zone, used for - security vulnerability reporting. - - 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._get( - f"/zones/{zone_id}/security-center/securitytxt", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SecurityTXTGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[SecurityTXTGetResponse]], ResultWrapper[SecurityTXTGetResponse]), - ) - - -class AsyncSecurityTXTResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncSecurityTXTResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncSecurityTXTResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSecurityTXTResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncSecurityTXTResourceWithStreamingResponse(self) - - async def update( - self, - *, - zone_id: str, - acknowledgments: SequenceNotStr[str] | Omit = omit, - canonical: SequenceNotStr[str] | Omit = omit, - contact: SequenceNotStr[str] | Omit = omit, - enabled: bool | Omit = omit, - encryption: SequenceNotStr[str] | Omit = omit, - expires: Union[str, datetime] | Omit = omit, - hiring: SequenceNotStr[str] | Omit = omit, - policy: SequenceNotStr[str] | Omit = omit, - preferred_languages: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SecurityTXTUpdateResponse: - """ - Updates the security.txt file configuration for a zone, which provides security - researchers with vulnerability reporting 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}") - return await self._put( - f"/zones/{zone_id}/security-center/securitytxt", - body=await async_maybe_transform( - { - "acknowledgments": acknowledgments, - "canonical": canonical, - "contact": contact, - "enabled": enabled, - "encryption": encryption, - "expires": expires, - "hiring": hiring, - "policy": policy, - "preferred_languages": preferred_languages, - }, - security_txt_update_params.SecurityTXTUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SecurityTXTUpdateResponse, - ) - - async def delete( - 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, - ) -> SecurityTXTDeleteResponse: - """Removes the security.txt file configuration for a zone. - - The - /.well-known/security.txt endpoint will no longer be served. - - 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 await self._delete( - f"/zones/{zone_id}/security-center/securitytxt", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SecurityTXTDeleteResponse, - ) - - async def get( - 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, - ) -> Optional[SecurityTXTGetResponse]: - """ - Retrieves the current security.txt file configuration for a zone, used for - security vulnerability reporting. - - 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 await self._get( - f"/zones/{zone_id}/security-center/securitytxt", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[Optional[SecurityTXTGetResponse]]._unwrapper, - ), - cast_to=cast(Type[Optional[SecurityTXTGetResponse]], ResultWrapper[SecurityTXTGetResponse]), - ) - - -class SecurityTXTResourceWithRawResponse: - def __init__(self, security_txt: SecurityTXTResource) -> None: - self._security_txt = security_txt - - self.update = to_raw_response_wrapper( - security_txt.update, - ) - self.delete = to_raw_response_wrapper( - security_txt.delete, - ) - self.get = to_raw_response_wrapper( - security_txt.get, - ) - - -class AsyncSecurityTXTResourceWithRawResponse: - def __init__(self, security_txt: AsyncSecurityTXTResource) -> None: - self._security_txt = security_txt - - self.update = async_to_raw_response_wrapper( - security_txt.update, - ) - self.delete = async_to_raw_response_wrapper( - security_txt.delete, - ) - self.get = async_to_raw_response_wrapper( - security_txt.get, - ) - - -class SecurityTXTResourceWithStreamingResponse: - def __init__(self, security_txt: SecurityTXTResource) -> None: - self._security_txt = security_txt - - self.update = to_streamed_response_wrapper( - security_txt.update, - ) - self.delete = to_streamed_response_wrapper( - security_txt.delete, - ) - self.get = to_streamed_response_wrapper( - security_txt.get, - ) - - -class AsyncSecurityTXTResourceWithStreamingResponse: - def __init__(self, security_txt: AsyncSecurityTXTResource) -> None: - self._security_txt = security_txt - - self.update = async_to_streamed_response_wrapper( - security_txt.update, - ) - self.delete = async_to_streamed_response_wrapper( - security_txt.delete, - ) - self.get = async_to_streamed_response_wrapper( - security_txt.get, - ) diff --git a/src/cloudflare/resources/security_txt/security_txt.py b/src/cloudflare/resources/security_txt/security_txt.py index 3fdbe155d8c..e9dc69474f1 100644 --- a/src/cloudflare/resources/security_txt/security_txt.py +++ b/src/cloudflare/resources/security_txt/security_txt.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> SecurityTXTResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, acknowledgments: SequenceNotStr[str] | Omit = omit, canonical: SequenceNotStr[str] | Omit = omit, contact: SequenceNotStr[str] | Omit = omit, @@ -82,8 +82,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -111,7 +109,7 @@ def update( def delete( self, *, - zone_id: str | None = None, + 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, @@ -135,8 +133,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -150,7 +146,7 @@ def delete( def get( self, *, - zone_id: str | None = None, + 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, @@ -173,8 +169,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -213,7 +207,7 @@ def with_streaming_response(self) -> AsyncSecurityTXTResourceWithStreamingRespon async def update( self, *, - zone_id: str | None = None, + zone_id: str, acknowledgments: SequenceNotStr[str] | Omit = omit, canonical: SequenceNotStr[str] | Omit = omit, contact: SequenceNotStr[str] | Omit = omit, @@ -245,8 +239,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -274,7 +266,7 @@ async def update( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -298,8 +290,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -313,7 +303,7 @@ async def delete( async def get( self, *, - zone_id: str | None = None, + 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, @@ -336,8 +326,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/snippets/content.py b/src/cloudflare/resources/snippets/content.py index ce79f0dcc53..d83fd178c88 100644 --- a/src/cloudflare/resources/snippets/content.py +++ b/src/cloudflare/resources/snippets/content.py @@ -47,7 +47,7 @@ def get( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -113,7 +111,7 @@ async def get( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -137,8 +135,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: diff --git a/src/cloudflare/resources/snippets/rules.py b/src/cloudflare/resources/snippets/rules.py index ae04f928cee..56a5724bd86 100644 --- a/src/cloudflare/resources/snippets/rules.py +++ b/src/cloudflare/resources/snippets/rules.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -91,7 +89,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -113,8 +111,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -132,7 +128,7 @@ def list( def delete( self, *, - zone_id: str | None = None, + 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, @@ -154,8 +150,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -194,7 +188,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -219,8 +213,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -239,7 +231,7 @@ async def update( async def list( self, *, - zone_id: str | None = None, + 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, @@ -261,8 +253,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( @@ -280,7 +270,7 @@ async def list( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -302,8 +292,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( diff --git a/src/cloudflare/resources/snippets/snippets.py b/src/cloudflare/resources/snippets/snippets.py index abadd7a554d..30bb151ede6 100644 --- a/src/cloudflare/resources/snippets/snippets.py +++ b/src/cloudflare/resources/snippets/snippets.py @@ -75,7 +75,7 @@ def update( self, snippet_name: str, *, - zone_id: str | None = None, + zone_id: str, metadata: snippet_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -102,8 +102,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -129,7 +127,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -157,8 +155,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -184,7 +180,7 @@ def delete( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -208,8 +204,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -230,7 +224,7 @@ def get( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -254,8 +248,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -305,7 +297,7 @@ async def update( self, snippet_name: str, *, - zone_id: str | None = None, + zone_id: str, metadata: snippet_update_params.Metadata, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -332,8 +324,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -359,7 +349,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -387,8 +377,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -414,7 +402,7 @@ async def delete( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -438,8 +426,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: @@ -460,7 +446,7 @@ async def get( self, snippet_name: str, *, - zone_id: str | None = None, + 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, @@ -484,8 +470,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not snippet_name: diff --git a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py index a9ff378ee2e..94762eff0f3 100644 --- a/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py +++ b/src/cloudflare/resources/spectrum/analytics/aggregates/currents.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> CurrentsResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + zone_id: str, app_id: str | Omit = omit, colo_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -124,7 +122,7 @@ def with_streaming_response(self) -> AsyncCurrentsResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + zone_id: str, app_id: str | Omit = omit, colo_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -154,8 +152,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py index 6f21432f782..2233ddd0c92 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/bytimes.py +++ b/src/cloudflare/resources/spectrum/analytics/events/bytimes.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> BytimesResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + zone_id: str, time_delta: Literal["year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"], dimensions: List[Dimension] | Omit = omit, filters: str | Omit = omit, @@ -134,8 +134,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -186,7 +184,7 @@ def with_streaming_response(self) -> AsyncBytimesResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + zone_id: str, time_delta: Literal["year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"], dimensions: List[Dimension] | Omit = omit, filters: str | Omit = omit, @@ -270,8 +268,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/spectrum/analytics/events/summaries.py b/src/cloudflare/resources/spectrum/analytics/events/summaries.py index 49f04526f01..ede4d8dd411 100644 --- a/src/cloudflare/resources/spectrum/analytics/events/summaries.py +++ b/src/cloudflare/resources/spectrum/analytics/events/summaries.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> SummariesResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + zone_id: str, dimensions: List[Dimension] | Omit = omit, filters: str | Omit = omit, metrics: List[ @@ -131,8 +131,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -182,7 +180,7 @@ def with_streaming_response(self) -> AsyncSummariesResourceWithStreamingResponse async def get( self, *, - zone_id: str | None = None, + zone_id: str, dimensions: List[Dimension] | Omit = omit, filters: str | Omit = omit, metrics: List[ @@ -263,8 +261,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/spectrum/apps.py b/src/cloudflare/resources/spectrum/apps.py index 49cc58bb679..ccb359d93d9 100644 --- a/src/cloudflare/resources/spectrum/apps.py +++ b/src/cloudflare/resources/spectrum/apps.py @@ -58,7 +58,7 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"], @@ -135,7 +135,7 @@ def create( def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, origin_direct: SequenceNotStr[str] | Omit = omit, @@ -171,11 +171,11 @@ def create( """ ... - @required_args(["dns", "protocol", "traffic_type"], ["dns", "protocol"]) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"] | Omit = omit, @@ -194,8 +194,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -236,7 +234,7 @@ def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"], @@ -316,7 +314,7 @@ def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, origin_direct: SequenceNotStr[str] | Omit = omit, @@ -354,12 +352,12 @@ def update( """ ... - @required_args(["dns", "protocol", "traffic_type"], ["dns", "protocol"]) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"] | Omit = omit, @@ -378,8 +376,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: @@ -420,7 +416,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | Omit = omit, page: float | Omit = omit, @@ -456,8 +452,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -485,7 +479,7 @@ def delete( self, app_id: str, *, - zone_id: str | None = None, + 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, @@ -509,8 +503,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: @@ -531,7 +523,7 @@ def get( self, app_id: str, *, - zone_id: str | None = None, + 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, @@ -555,8 +547,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: @@ -603,7 +593,7 @@ def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"], @@ -680,7 +670,7 @@ async def create( async def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, origin_direct: SequenceNotStr[str] | Omit = omit, @@ -716,11 +706,11 @@ async def create( """ ... - @required_args(["dns", "protocol", "traffic_type"], ["dns", "protocol"]) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) async def create( self, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"] | Omit = omit, @@ -739,8 +729,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppCreateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return cast( @@ -781,7 +769,7 @@ async def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"], @@ -861,7 +849,7 @@ async def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, origin_direct: SequenceNotStr[str] | Omit = omit, @@ -899,12 +887,12 @@ async def update( """ ... - @required_args(["dns", "protocol", "traffic_type"], ["dns", "protocol"]) + @required_args(["zone_id", "dns", "protocol", "traffic_type"], ["zone_id", "dns", "protocol"]) async def update( self, app_id: str, *, - zone_id: str | None = None, + zone_id: str, dns: DNSParam, protocol: str, traffic_type: Literal["direct", "http", "https"] | Omit = omit, @@ -923,8 +911,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AppUpdateResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: @@ -965,7 +951,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, direction: Literal["asc", "desc"] | Omit = omit, order: Literal["protocol", "app_id", "created_on", "modified_on", "dns"] | Omit = omit, page: float | Omit = omit, @@ -1001,8 +987,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -1030,7 +1014,7 @@ async def delete( self, app_id: str, *, - zone_id: str | None = None, + 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, @@ -1054,8 +1038,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: @@ -1076,7 +1058,7 @@ async def get( self, app_id: str, *, - zone_id: str | None = None, + 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, @@ -1100,8 +1082,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not app_id: diff --git a/src/cloudflare/resources/speed/availabilities.py b/src/cloudflare/resources/speed/availabilities.py index ef601886701..d49eaa6ae00 100644 --- a/src/cloudflare/resources/speed/availabilities.py +++ b/src/cloudflare/resources/speed/availabilities.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> AvailabilitiesResourceWithStreamingResponse def list( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncAvailabilitiesResourceWithStreamingRes async def list( self, *, - zone_id: str | None = None, + 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, @@ -130,8 +128,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/speed/pages/pages.py b/src/cloudflare/resources/speed/pages/pages.py index c00b9aee194..e9ad7d05ad6 100644 --- a/src/cloudflare/resources/speed/pages/pages.py +++ b/src/cloudflare/resources/speed/pages/pages.py @@ -63,7 +63,7 @@ def with_streaming_response(self) -> PagesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + 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, @@ -85,8 +85,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -102,7 +100,7 @@ def trend( self, url: str, *, - zone_id: str | None = None, + zone_id: str, device_type: Literal["DESKTOP", "MOBILE"], metrics: str, region: Literal[ @@ -162,8 +160,6 @@ def trend( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -219,7 +215,7 @@ def with_streaming_response(self) -> AsyncPagesResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + 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, @@ -241,8 +237,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -258,7 +252,7 @@ async def trend( self, url: str, *, - zone_id: str | None = None, + zone_id: str, device_type: Literal["DESKTOP", "MOBILE"], metrics: str, region: Literal[ @@ -318,8 +312,6 @@ async def trend( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: diff --git a/src/cloudflare/resources/speed/pages/tests.py b/src/cloudflare/resources/speed/pages/tests.py index 15b1d90451c..314ad513378 100644 --- a/src/cloudflare/resources/speed/pages/tests.py +++ b/src/cloudflare/resources/speed/pages/tests.py @@ -53,7 +53,7 @@ def create( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -103,8 +103,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -126,7 +124,7 @@ def list( self, url: str, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, region: Literal[ @@ -178,8 +176,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -208,7 +204,7 @@ def delete( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -260,8 +256,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -283,7 +277,7 @@ def get( self, test_id: str, *, - zone_id: str | None = None, + zone_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. @@ -308,8 +302,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -355,7 +347,7 @@ async def create( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -405,8 +397,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -428,7 +418,7 @@ def list( self, url: str, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, region: Literal[ @@ -480,8 +470,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -510,7 +498,7 @@ async def delete( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -562,8 +550,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -585,7 +571,7 @@ async def get( self, test_id: str, *, - zone_id: str | None = None, + zone_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. @@ -610,8 +596,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: diff --git a/src/cloudflare/resources/speed/schedule.py b/src/cloudflare/resources/speed/schedule.py index 7bae23c10dd..c2b2a6d00a9 100644 --- a/src/cloudflare/resources/speed/schedule.py +++ b/src/cloudflare/resources/speed/schedule.py @@ -51,7 +51,7 @@ def create( self, url: str, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["DAILY", "WEEKLY"] | Omit = omit, region: Literal[ "asia-east1", @@ -105,8 +105,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -134,7 +132,7 @@ def delete( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -184,8 +182,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -207,7 +203,7 @@ def get( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -257,8 +253,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -301,7 +295,7 @@ async def create( self, url: str, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["DAILY", "WEEKLY"] | Omit = omit, region: Literal[ "asia-east1", @@ -355,8 +349,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -384,7 +376,7 @@ async def delete( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -434,8 +426,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: @@ -457,7 +447,7 @@ async def get( self, url: str, *, - zone_id: str | None = None, + zone_id: str, region: Literal[ "asia-east1", "asia-northeast1", @@ -507,8 +497,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not url: diff --git a/src/cloudflare/resources/ssl/analyze.py b/src/cloudflare/resources/ssl/analyze.py index bbf38bf7631..29e1aa8b009 100644 --- a/src/cloudflare/resources/ssl/analyze.py +++ b/src/cloudflare/resources/ssl/analyze.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> AnalyzeResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -127,7 +125,7 @@ def with_streaming_response(self) -> AsyncAnalyzeResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -159,8 +157,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( diff --git a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py index 62643b003c4..920d8d7de1f 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py @@ -66,7 +66,7 @@ def with_streaming_response(self) -> CertificatePacksResourceWithStreamingRespon def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"], hosts: SequenceNotStr[Host], type: Literal["advanced"], @@ -110,8 +110,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -140,7 +138,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, deploy: Literal["staging", "production"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -174,8 +172,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -203,7 +199,7 @@ def delete( self, certificate_pack_id: str, *, - zone_id: str | None = None, + 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, @@ -227,8 +223,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -255,7 +249,7 @@ def edit( self, certificate_pack_id: str, *, - zone_id: str | None = None, + zone_id: str, cloudflare_branding: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -285,8 +279,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -316,7 +308,7 @@ def get( self, certificate_pack_id: str, *, - zone_id: str | None = None, + 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, @@ -340,8 +332,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -392,7 +382,7 @@ def with_streaming_response(self) -> AsyncCertificatePacksResourceWithStreamingR async def create( self, *, - zone_id: str | None = None, + zone_id: str, certificate_authority: Literal["google", "lets_encrypt", "ssl_com"], hosts: SequenceNotStr[Host], type: Literal["advanced"], @@ -436,8 +426,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -466,7 +454,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, deploy: Literal["staging", "production"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -500,8 +488,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -529,7 +515,7 @@ async def delete( self, certificate_pack_id: str, *, - zone_id: str | None = None, + 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, @@ -553,8 +539,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -581,7 +565,7 @@ async def edit( self, certificate_pack_id: str, *, - zone_id: str | None = None, + zone_id: str, cloudflare_branding: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -611,8 +595,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -642,7 +624,7 @@ async def get( self, certificate_pack_id: str, *, - zone_id: str | None = None, + 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, @@ -666,8 +648,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: diff --git a/src/cloudflare/resources/ssl/certificate_packs/quota.py b/src/cloudflare/resources/ssl/certificate_packs/quota.py index 08734ac421c..a22a3b1f2de 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/quota.py +++ b/src/cloudflare/resources/ssl/certificate_packs/quota.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> QuotaResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncQuotaResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -130,8 +128,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/ssl/recommendations.py b/src/cloudflare/resources/ssl/recommendations.py index ac79e98b332..3d3f2366583 100644 --- a/src/cloudflare/resources/ssl/recommendations.py +++ b/src/cloudflare/resources/ssl/recommendations.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> RecommendationsResourceWithStreamingRespons def get( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -109,7 +107,7 @@ def with_streaming_response(self) -> AsyncRecommendationsResourceWithStreamingRe async def get( self, *, - zone_id: str | None = None, + 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, @@ -129,8 +127,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/ssl/universal/settings.py b/src/cloudflare/resources/ssl/universal/settings.py index a470b4797f2..d1f70c5180e 100644 --- a/src/cloudflare/resources/ssl/universal/settings.py +++ b/src/cloudflare/resources/ssl/universal/settings.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -96,8 +96,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -116,7 +114,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -138,8 +136,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -178,7 +174,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -227,8 +223,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -247,7 +241,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -269,8 +263,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/ssl/verification.py b/src/cloudflare/resources/ssl/verification.py index 294c5ce1618..d0137fa67f7 100644 --- a/src/cloudflare/resources/ssl/verification.py +++ b/src/cloudflare/resources/ssl/verification.py @@ -50,7 +50,7 @@ def edit( self, certificate_pack_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_method: Literal["http", "cname", "txt", "email"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -81,8 +81,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -111,7 +109,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + zone_id: str, retry: Literal[True] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -136,8 +134,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -178,7 +174,7 @@ async def edit( self, certificate_pack_id: str, *, - zone_id: str | None = None, + zone_id: str, validation_method: Literal["http", "cname", "txt", "email"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -209,8 +205,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not certificate_pack_id: @@ -239,7 +233,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + zone_id: str, retry: Literal[True] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -264,8 +258,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/stream/audio_tracks.py b/src/cloudflare/resources/stream/audio_tracks.py index 213ae868e08..2b3de20e1db 100644 --- a/src/cloudflare/resources/stream/audio_tracks.py +++ b/src/cloudflare/resources/stream/audio_tracks.py @@ -50,7 +50,7 @@ def delete( self, audio_identifier: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -79,8 +79,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -108,7 +106,7 @@ def copy( self, identifier: str, *, - account_id: str | None = None, + account_id: str, label: str, url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -141,8 +139,6 @@ def copy( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -172,7 +168,7 @@ def edit( self, audio_identifier: str, *, - account_id: str | None = None, + account_id: str, identifier: str, default: bool | Omit = omit, label: str | Omit = omit, @@ -209,8 +205,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -245,7 +239,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -271,8 +265,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -316,7 +308,7 @@ async def delete( self, audio_identifier: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -345,8 +337,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -374,7 +364,7 @@ async def copy( self, identifier: str, *, - account_id: str | None = None, + account_id: str, label: str, url: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -407,8 +397,6 @@ async def copy( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -438,7 +426,7 @@ async def edit( self, audio_identifier: str, *, - account_id: str | None = None, + account_id: str, identifier: str, default: bool | Omit = omit, label: str | Omit = omit, @@ -475,8 +463,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -511,7 +497,7 @@ async def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -537,8 +523,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/captions/captions.py b/src/cloudflare/resources/stream/captions/captions.py index 52b7dcd4ff5..2053948afc2 100644 --- a/src/cloudflare/resources/stream/captions/captions.py +++ b/src/cloudflare/resources/stream/captions/captions.py @@ -57,7 +57,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -81,8 +81,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -127,7 +125,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -151,8 +149,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/captions/language/language.py b/src/cloudflare/resources/stream/captions/language/language.py index 151ec9bb169..ffebd1a6bd7 100644 --- a/src/cloudflare/resources/stream/captions/language/language.py +++ b/src/cloudflare/resources/stream/captions/language/language.py @@ -61,7 +61,7 @@ def create( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -117,7 +115,7 @@ def update( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: str, file: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -148,8 +146,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -182,7 +178,7 @@ def delete( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -209,8 +205,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -238,7 +232,7 @@ def get( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -265,8 +259,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -319,7 +311,7 @@ async def create( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -346,8 +338,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -375,7 +365,7 @@ async def update( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: str, file: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -406,8 +396,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -440,7 +428,7 @@ async def delete( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -467,8 +455,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -496,7 +482,7 @@ async def get( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -523,8 +509,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/captions/language/vtt.py b/src/cloudflare/resources/stream/captions/language/vtt.py index 6b2c962cc66..9f4d6e19c39 100644 --- a/src/cloudflare/resources/stream/captions/language/vtt.py +++ b/src/cloudflare/resources/stream/captions/language/vtt.py @@ -43,7 +43,7 @@ def get( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -70,8 +70,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -117,7 +115,7 @@ async def get( self, language: str, *, - account_id: str | None = None, + account_id: str, identifier: 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. @@ -144,8 +142,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/clip.py b/src/cloudflare/resources/stream/clip.py index 939f5d0f756..9612e4d90e2 100644 --- a/src/cloudflare/resources/stream/clip.py +++ b/src/cloudflare/resources/stream/clip.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> ClipResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, clipped_from_video_uid: str, end_time_seconds: int, start_time_seconds: int, @@ -117,8 +117,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -175,7 +173,7 @@ def with_streaming_response(self) -> AsyncClipResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, clipped_from_video_uid: str, end_time_seconds: int, start_time_seconds: int, @@ -243,8 +241,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/stream/copy.py b/src/cloudflare/resources/stream/copy.py index 85846e6b20d..a8259efa7fe 100644 --- a/src/cloudflare/resources/stream/copy.py +++ b/src/cloudflare/resources/stream/copy.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> CopyResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, input: str | Omit = omit, @@ -117,8 +117,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Upload-Creator": upload_creator}), **(extra_headers or {})} @@ -173,7 +171,7 @@ def with_streaming_response(self) -> AsyncCopyResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, input: str | Omit = omit, @@ -241,8 +239,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Upload-Creator": upload_creator}), **(extra_headers or {})} diff --git a/src/cloudflare/resources/stream/direct_upload.py b/src/cloudflare/resources/stream/direct_upload.py index ff83d3c787f..84cda4fbf76 100644 --- a/src/cloudflare/resources/stream/direct_upload.py +++ b/src/cloudflare/resources/stream/direct_upload.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> DirectUploadResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, max_duration_seconds: int, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, @@ -111,8 +111,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Upload-Creator": upload_creator}), **(extra_headers or {})} @@ -166,7 +164,7 @@ def with_streaming_response(self) -> AsyncDirectUploadResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, max_duration_seconds: int, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, @@ -228,8 +226,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {**strip_not_given({"Upload-Creator": upload_creator}), **(extra_headers or {})} diff --git a/src/cloudflare/resources/stream/downloads.py b/src/cloudflare/resources/stream/downloads.py index ffce99c8df8..49402424838 100644 --- a/src/cloudflare/resources/stream/downloads.py +++ b/src/cloudflare/resources/stream/downloads.py @@ -49,7 +49,7 @@ def create( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -100,7 +98,7 @@ def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -126,8 +124,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -150,7 +146,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -174,8 +170,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -219,7 +213,7 @@ async def create( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -246,8 +240,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -270,7 +262,7 @@ async def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -296,8 +288,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -320,7 +310,7 @@ async def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -344,8 +334,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/embed.py b/src/cloudflare/resources/stream/embed.py index 3efc505a62a..33286ce091d 100644 --- a/src/cloudflare/resources/stream/embed.py +++ b/src/cloudflare/resources/stream/embed.py @@ -43,7 +43,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -111,7 +109,7 @@ async def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -137,8 +135,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/keys.py b/src/cloudflare/resources/stream/keys.py index 3b99aad41f0..36f9ee5843f 100644 --- a/src/cloudflare/resources/stream/keys.py +++ b/src/cloudflare/resources/stream/keys.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> KeysResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -97,7 +95,7 @@ def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -121,8 +119,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -144,7 +140,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -166,8 +162,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -203,7 +197,7 @@ def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -229,8 +223,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -250,7 +242,7 @@ async def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -274,8 +266,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -297,7 +287,7 @@ async def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -319,8 +309,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/stream/live_inputs/live_inputs.py b/src/cloudflare/resources/stream/live_inputs/live_inputs.py index c0a9d7fb541..6b20df96406 100644 --- a/src/cloudflare/resources/stream/live_inputs/live_inputs.py +++ b/src/cloudflare/resources/stream/live_inputs/live_inputs.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> LiveInputsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, enabled: bool | Omit = omit, @@ -105,8 +105,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -135,7 +133,7 @@ def update( self, live_input_identifier: str, *, - account_id: str | None = None, + account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, enabled: bool | Omit = omit, @@ -181,8 +179,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -218,7 +214,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, include_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -246,8 +242,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -267,7 +261,7 @@ def delete( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -292,8 +286,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -317,7 +309,7 @@ def get( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -341,8 +333,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -393,7 +383,7 @@ def with_streaming_response(self) -> AsyncLiveInputsResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, enabled: bool | Omit = omit, @@ -438,8 +428,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -468,7 +456,7 @@ async def update( self, live_input_identifier: str, *, - account_id: str | None = None, + account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, enabled: bool | Omit = omit, @@ -514,8 +502,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -551,7 +537,7 @@ async def update( async def list( self, *, - account_id: str | None = None, + account_id: str, include_counts: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -579,8 +565,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -602,7 +586,7 @@ async def delete( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -627,8 +611,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -652,7 +634,7 @@ async def get( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -676,8 +658,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: diff --git a/src/cloudflare/resources/stream/live_inputs/outputs.py b/src/cloudflare/resources/stream/live_inputs/outputs.py index b41a61991c9..2a2d46a7693 100644 --- a/src/cloudflare/resources/stream/live_inputs/outputs.py +++ b/src/cloudflare/resources/stream/live_inputs/outputs.py @@ -49,7 +49,7 @@ def create( self, live_input_identifier: str, *, - account_id: str | None = None, + account_id: str, stream_key: str, url: str, enabled: bool | Omit = omit, @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -124,7 +122,7 @@ def update( self, output_identifier: str, *, - account_id: str | None = None, + account_id: str, live_input_identifier: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -158,8 +156,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -190,7 +186,7 @@ def list( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -214,8 +210,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -239,7 +233,7 @@ def delete( self, output_identifier: str, *, - account_id: str | None = None, + account_id: str, live_input_identifier: 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. @@ -266,8 +260,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -315,7 +307,7 @@ async def create( self, live_input_identifier: str, *, - account_id: str | None = None, + account_id: str, stream_key: str, url: str, enabled: bool | Omit = omit, @@ -354,8 +346,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -390,7 +380,7 @@ async def update( self, output_identifier: str, *, - account_id: str | None = None, + account_id: str, live_input_identifier: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -424,8 +414,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -456,7 +444,7 @@ def list( self, live_input_identifier: str, *, - account_id: str | None = None, + account_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, @@ -480,8 +468,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: @@ -505,7 +491,7 @@ async def delete( self, output_identifier: str, *, - account_id: str | None = None, + account_id: str, live_input_identifier: 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. @@ -532,8 +518,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not live_input_identifier: diff --git a/src/cloudflare/resources/stream/stream.py b/src/cloudflare/resources/stream/stream.py index b8f8aeb18ab..b273873900d 100644 --- a/src/cloudflare/resources/stream/stream.py +++ b/src/cloudflare/resources/stream/stream.py @@ -207,7 +207,7 @@ def with_streaming_response(self) -> StreamResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, tus_resumable: Literal["1.0.0"], upload_length: int, direct_user: bool | Omit = omit, @@ -254,8 +254,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -285,7 +283,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, after: Union[str, datetime] | Omit = omit, asc: bool | Omit = omit, @@ -358,8 +356,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -398,7 +394,7 @@ def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -422,8 +418,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -441,7 +435,7 @@ def edit( self, identifier: str, *, - account_id: str | None = None, + account_id: str, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, max_duration_seconds: int | Omit = omit, @@ -510,8 +504,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -547,7 +539,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -571,8 +563,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -665,7 +655,7 @@ def with_streaming_response(self) -> AsyncStreamResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, tus_resumable: Literal["1.0.0"], upload_length: int, direct_user: bool | Omit = omit, @@ -712,8 +702,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -745,7 +733,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, after: Union[str, datetime] | Omit = omit, asc: bool | Omit = omit, @@ -818,8 +806,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -858,7 +844,7 @@ async def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -882,8 +868,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -901,7 +885,7 @@ async def edit( self, identifier: str, *, - account_id: str | None = None, + account_id: str, allowed_origins: SequenceNotStr[AllowedOrigins] | Omit = omit, creator: str | Omit = omit, max_duration_seconds: int | Omit = omit, @@ -970,8 +954,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -1007,7 +989,7 @@ async def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -1031,8 +1013,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/token.py b/src/cloudflare/resources/stream/token.py index fac02b60e45..f54a80bf1df 100644 --- a/src/cloudflare/resources/stream/token.py +++ b/src/cloudflare/resources/stream/token.py @@ -48,7 +48,7 @@ def create( self, identifier: str, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, access_rules: Iterable[token_create_params.AccessRule] | Omit = omit, downloadable: bool | Omit = omit, @@ -104,8 +104,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -161,7 +159,7 @@ async def create( self, identifier: str, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, access_rules: Iterable[token_create_params.AccessRule] | Omit = omit, downloadable: bool | Omit = omit, @@ -217,8 +215,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/videos.py b/src/cloudflare/resources/stream/videos.py index e62acfbb4cf..50aad95d5da 100644 --- a/src/cloudflare/resources/stream/videos.py +++ b/src/cloudflare/resources/stream/videos.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> VideosResourceWithStreamingResponse: def storage_usage( self, *, - account_id: str | None = None, + account_id: str, creator: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def storage_usage( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncVideosResourceWithStreamingResponse: async def storage_usage( self, *, - account_id: str | None = None, + account_id: str, creator: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ async def storage_usage( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/stream/watermarks.py b/src/cloudflare/resources/stream/watermarks.py index 7e0e1056ef3..8579af5865c 100644 --- a/src/cloudflare/resources/stream/watermarks.py +++ b/src/cloudflare/resources/stream/watermarks.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> WatermarksResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, opacity: float | Omit = omit, padding: float | Omit = omit, @@ -99,8 +99,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -129,7 +127,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -151,8 +149,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -168,7 +164,7 @@ def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -192,8 +188,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -216,7 +210,7 @@ def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -240,8 +234,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -284,7 +276,7 @@ def with_streaming_response(self) -> AsyncWatermarksResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, opacity: float | Omit = omit, padding: float | Omit = omit, @@ -334,8 +326,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -364,7 +354,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -386,8 +376,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -403,7 +391,7 @@ async def delete( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -427,8 +415,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: @@ -451,7 +437,7 @@ async def get( self, identifier: str, *, - account_id: str | None = None, + account_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, @@ -475,8 +461,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identifier: diff --git a/src/cloudflare/resources/stream/webhooks.py b/src/cloudflare/resources/stream/webhooks.py index 685e9f8e3a1..5021dc16832 100644 --- a/src/cloudflare/resources/stream/webhooks.py +++ b/src/cloudflare/resources/stream/webhooks.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> WebhooksResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, body_notification_url_1: str | Omit = omit, body_notification_url_2: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -103,7 +101,7 @@ def update( def delete( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -144,7 +140,7 @@ def delete( def get( self, *, - account_id: str | None = None, + account_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, @@ -166,8 +162,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -206,7 +200,7 @@ def with_streaming_response(self) -> AsyncWebhooksResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, body_notification_url_1: str | Omit = omit, body_notification_url_2: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -234,8 +228,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -260,7 +252,7 @@ async def update( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -282,8 +274,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -301,7 +291,7 @@ async def delete( async def get( self, *, - account_id: str | None = None, + account_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, @@ -323,8 +313,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/token_validation/configuration/configuration.py b/src/cloudflare/resources/token_validation/configuration/configuration.py index 25674c44c92..ecf64263d00 100644 --- a/src/cloudflare/resources/token_validation/configuration/configuration.py +++ b/src/cloudflare/resources/token_validation/configuration/configuration.py @@ -63,7 +63,7 @@ def with_streaming_response(self) -> ConfigurationResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, credentials: configuration_create_params.Credentials, description: str, title: str, @@ -90,8 +90,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -119,7 +117,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -147,8 +145,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -174,7 +170,7 @@ def delete( self, config_id: str, *, - zone_id: str | None = None, + 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, @@ -198,8 +194,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -220,7 +214,7 @@ def edit( self, config_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, title: str | Omit = omit, token_sources: SequenceNotStr[str] | Omit = omit, @@ -247,8 +241,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -277,7 +269,7 @@ def get( self, config_id: str, *, - zone_id: str | None = None, + 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, @@ -301,8 +293,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -347,7 +337,7 @@ def with_streaming_response(self) -> AsyncConfigurationResourceWithStreamingResp async def create( self, *, - zone_id: str | None = None, + zone_id: str, credentials: configuration_create_params.Credentials, description: str, title: str, @@ -374,8 +364,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -403,7 +391,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -431,8 +419,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -458,7 +444,7 @@ async def delete( self, config_id: str, *, - zone_id: str | None = None, + 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, @@ -482,8 +468,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -504,7 +488,7 @@ async def edit( self, config_id: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, title: str | Omit = omit, token_sources: SequenceNotStr[str] | Omit = omit, @@ -531,8 +515,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -561,7 +543,7 @@ async def get( self, config_id: str, *, - zone_id: str | None = None, + 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, @@ -585,8 +567,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: diff --git a/src/cloudflare/resources/token_validation/configuration/credentials.py b/src/cloudflare/resources/token_validation/configuration/credentials.py index 1f9f262623c..310943b70e0 100644 --- a/src/cloudflare/resources/token_validation/configuration/credentials.py +++ b/src/cloudflare/resources/token_validation/configuration/credentials.py @@ -47,7 +47,7 @@ def update( self, config_id: str, *, - zone_id: str | None = None, + zone_id: str, keys: Iterable[credential_update_params.Key], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: @@ -114,7 +112,7 @@ async def update( self, config_id: str, *, - zone_id: str | None = None, + zone_id: str, keys: Iterable[credential_update_params.Key], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -139,8 +137,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not config_id: diff --git a/src/cloudflare/resources/token_validation/rules.py b/src/cloudflare/resources/token_validation/rules.py index fb183bec83e..1ac41dc3740 100644 --- a/src/cloudflare/resources/token_validation/rules.py +++ b/src/cloudflare/resources/token_validation/rules.py @@ -55,7 +55,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, action: Literal["log", "block"], description: str, enabled: bool, @@ -103,8 +103,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -133,7 +131,7 @@ def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, action: Literal["log", "block"] | Omit = omit, enabled: bool | Omit = omit, @@ -183,8 +181,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -217,7 +213,7 @@ def delete( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -241,8 +237,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -262,7 +256,7 @@ def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[rule_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -287,8 +281,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -305,7 +297,7 @@ def bulk_create( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[rule_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -334,8 +326,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -353,7 +343,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["log", "block"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -406,8 +396,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -440,7 +428,7 @@ def get( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -464,8 +452,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -506,7 +492,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, action: Literal["log", "block"], description: str, enabled: bool, @@ -554,8 +540,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -584,7 +568,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + zone_id: str, id: str | Omit = omit, action: Literal["log", "block"] | Omit = omit, enabled: bool | Omit = omit, @@ -634,8 +618,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -668,7 +650,7 @@ async def delete( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -692,8 +674,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -713,7 +693,7 @@ async def delete( def bulk_create( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[rule_bulk_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -738,8 +718,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -756,7 +734,7 @@ def bulk_create( def bulk_edit( self, *, - zone_id: str | None = None, + zone_id: str, body: Iterable[rule_bulk_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -785,8 +763,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -804,7 +780,7 @@ async def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["log", "block"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, @@ -857,8 +833,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: @@ -891,7 +865,7 @@ async def get( self, rule_id: str, *, - zone_id: str | None = None, + 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, @@ -915,8 +889,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/turnstile/widgets.py b/src/cloudflare/resources/turnstile/widgets.py index 902315f4396..1226ec3d632 100644 --- a/src/cloudflare/resources/turnstile/widgets.py +++ b/src/cloudflare/resources/turnstile/widgets.py @@ -56,7 +56,7 @@ def with_streaming_response(self) -> WidgetsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, @@ -129,8 +129,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -172,7 +170,7 @@ def update( self, sitekey: str, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, @@ -222,8 +220,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -258,7 +254,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, filter: str | Omit = omit, order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | Omit = omit, @@ -305,8 +301,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -335,7 +329,7 @@ def delete( self, sitekey: str, *, - account_id: str | None = None, + account_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, @@ -359,8 +353,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -383,7 +375,7 @@ def get( self, sitekey: str, *, - account_id: str | None = None, + account_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, @@ -407,8 +399,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -431,7 +421,7 @@ def rotate_secret( self, sitekey: str, *, - account_id: str | None = None, + account_id: str, invalidate_immediately: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -464,8 +454,6 @@ def rotate_secret( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -513,7 +501,7 @@ def with_streaming_response(self) -> AsyncWidgetsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, @@ -586,8 +574,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -629,7 +615,7 @@ async def update( self, sitekey: str, *, - account_id: str | None = None, + account_id: str, domains: SequenceNotStr[WidgetDomain], mode: Literal["non-interactive", "invisible", "managed"], name: str, @@ -679,8 +665,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -715,7 +699,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, direction: Literal["asc", "desc"] | Omit = omit, filter: str | Omit = omit, order: Literal["id", "sitekey", "name", "created_on", "modified_on"] | Omit = omit, @@ -762,8 +746,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -792,7 +774,7 @@ async def delete( self, sitekey: str, *, - account_id: str | None = None, + account_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, @@ -816,8 +798,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -840,7 +820,7 @@ async def get( self, sitekey: str, *, - account_id: str | None = None, + account_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, @@ -864,8 +844,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: @@ -888,7 +866,7 @@ async def rotate_secret( self, sitekey: str, *, - account_id: str | None = None, + account_id: str, invalidate_immediately: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -921,8 +899,6 @@ async def rotate_secret( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not sitekey: diff --git a/src/cloudflare/resources/url_normalization.py b/src/cloudflare/resources/url_normalization.py deleted file mode 100644 index 2d69292f055..00000000000 --- a/src/cloudflare/resources/url_normalization.py +++ /dev/null @@ -1,382 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, cast -from typing_extensions import Literal - -import httpx - -from .._types import Body, Query, Headers, NoneType, NotGiven, not_given -from .._utils import maybe_transform, async_maybe_transform -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._wrappers import ResultWrapper -from .._base_client import make_request_options -from ..types.url_normalization import url_normalization_update_params -from ..types.url_normalization.url_normalization_get_response import URLNormalizationGetResponse -from ..types.url_normalization.url_normalization_update_response import URLNormalizationUpdateResponse - -__all__ = ["URLNormalizationResource", "AsyncURLNormalizationResource"] - - -class URLNormalizationResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> URLNormalizationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return URLNormalizationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> URLNormalizationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return URLNormalizationResourceWithStreamingResponse(self) - - def update( - self, - *, - zone_id: str, - scope: Literal["incoming", "both", "none"], - type: Literal["cloudflare", "rfc3986"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> URLNormalizationUpdateResponse: - """ - Updates the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - scope: The scope of the URL normalization. - - type: The type of URL normalization performed by Cloudflare. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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._put( - f"/zones/{zone_id}/url_normalization", - body=maybe_transform( - { - "scope": scope, - "type": type, - }, - url_normalization_update_params.URLNormalizationUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), - ) - - def delete( - 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, - ) -> None: - """ - Deletes the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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": "*/*", **(extra_headers or {})} - return self._delete( - f"/zones/{zone_id}/url_normalization", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - def get( - 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, - ) -> URLNormalizationGetResponse: - """ - Fetches the current URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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( - f"/zones/{zone_id}/url_normalization", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), - ) - - -class AsyncURLNormalizationResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncURLNormalizationResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncURLNormalizationResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncURLNormalizationResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncURLNormalizationResourceWithStreamingResponse(self) - - async def update( - self, - *, - zone_id: str, - scope: Literal["incoming", "both", "none"], - type: Literal["cloudflare", "rfc3986"], - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> URLNormalizationUpdateResponse: - """ - Updates the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - scope: The scope of the URL normalization. - - type: The type of URL normalization performed by Cloudflare. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._put( - f"/zones/{zone_id}/url_normalization", - body=await async_maybe_transform( - { - "scope": scope, - "type": type, - }, - url_normalization_update_params.URLNormalizationUpdateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationUpdateResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationUpdateResponse], ResultWrapper[URLNormalizationUpdateResponse]), - ) - - async def delete( - 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, - ) -> None: - """ - Deletes the URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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": "*/*", **(extra_headers or {})} - return await self._delete( - f"/zones/{zone_id}/url_normalization", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - - async def get( - 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, - ) -> URLNormalizationGetResponse: - """ - Fetches the current URL Normalization settings. - - Args: - zone_id: The unique ID of the zone. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters 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 await self._get( - f"/zones/{zone_id}/url_normalization", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[URLNormalizationGetResponse]._unwrapper, - ), - cast_to=cast(Type[URLNormalizationGetResponse], ResultWrapper[URLNormalizationGetResponse]), - ) - - -class URLNormalizationResourceWithRawResponse: - def __init__(self, url_normalization: URLNormalizationResource) -> None: - self._url_normalization = url_normalization - - self.update = to_raw_response_wrapper( - url_normalization.update, - ) - self.delete = to_raw_response_wrapper( - url_normalization.delete, - ) - self.get = to_raw_response_wrapper( - url_normalization.get, - ) - - -class AsyncURLNormalizationResourceWithRawResponse: - def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: - self._url_normalization = url_normalization - - self.update = async_to_raw_response_wrapper( - url_normalization.update, - ) - self.delete = async_to_raw_response_wrapper( - url_normalization.delete, - ) - self.get = async_to_raw_response_wrapper( - url_normalization.get, - ) - - -class URLNormalizationResourceWithStreamingResponse: - def __init__(self, url_normalization: URLNormalizationResource) -> None: - self._url_normalization = url_normalization - - self.update = to_streamed_response_wrapper( - url_normalization.update, - ) - self.delete = to_streamed_response_wrapper( - url_normalization.delete, - ) - self.get = to_streamed_response_wrapper( - url_normalization.get, - ) - - -class AsyncURLNormalizationResourceWithStreamingResponse: - def __init__(self, url_normalization: AsyncURLNormalizationResource) -> None: - self._url_normalization = url_normalization - - self.update = async_to_streamed_response_wrapper( - url_normalization.update, - ) - self.delete = async_to_streamed_response_wrapper( - url_normalization.delete, - ) - self.get = async_to_streamed_response_wrapper( - url_normalization.get, - ) diff --git a/src/cloudflare/resources/url_normalization/url_normalization.py b/src/cloudflare/resources/url_normalization/url_normalization.py index 7472f6aab34..c111aeccf77 100644 --- a/src/cloudflare/resources/url_normalization/url_normalization.py +++ b/src/cloudflare/resources/url_normalization/url_normalization.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> URLNormalizationResourceWithStreamingRespon def update( self, *, - zone_id: str | None = None, + zone_id: str, scope: Literal["incoming", "both", "none"], type: Literal["cloudflare", "rfc3986"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -103,7 +101,7 @@ def update( def delete( self, *, - zone_id: str | None = None, + 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, @@ -125,8 +123,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -141,7 +137,7 @@ def delete( def get( self, *, - zone_id: str | None = None, + 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, @@ -163,8 +159,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -203,7 +197,7 @@ def with_streaming_response(self) -> AsyncURLNormalizationResourceWithStreamingR async def update( self, *, - zone_id: str | None = None, + zone_id: str, scope: Literal["incoming", "both", "none"], type: Literal["cloudflare", "rfc3986"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -231,8 +225,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -257,7 +249,7 @@ async def update( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -279,8 +271,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -295,7 +285,7 @@ async def delete( async def get( self, *, - zone_id: str | None = None, + 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, @@ -317,8 +307,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/url_scanner/responses.py b/src/cloudflare/resources/url_scanner/responses.py index 4ba6626497c..952e01f51d8 100644 --- a/src/cloudflare/resources/url_scanner/responses.py +++ b/src/cloudflare/resources/url_scanner/responses.py @@ -43,7 +43,7 @@ def get( self, response_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not response_id: @@ -113,7 +111,7 @@ async def get( self, response_id: str, *, - account_id: str | None = None, + account_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, @@ -139,8 +137,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not response_id: diff --git a/src/cloudflare/resources/url_scanner/scans.py b/src/cloudflare/resources/url_scanner/scans.py index 8736952cbc1..a2c1862ef86 100644 --- a/src/cloudflare/resources/url_scanner/scans.py +++ b/src/cloudflare/resources/url_scanner/scans.py @@ -59,7 +59,7 @@ def with_streaming_response(self) -> ScansResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, url: str, agent_readiness: bool | Omit = omit, country: Literal[ @@ -302,8 +302,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -330,7 +328,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, q: str | Omit = omit, size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -366,8 +364,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -391,7 +387,7 @@ def list( def bulk_create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[scan_bulk_create_params.Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -420,8 +416,6 @@ def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -437,7 +431,7 @@ def dom( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -462,8 +456,6 @@ def dom( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -481,7 +473,7 @@ def get( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -505,8 +497,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -525,7 +515,7 @@ def har( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -551,8 +541,6 @@ def har( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -569,7 +557,7 @@ def screenshot( self, scan_id: str, *, - account_id: str | None = None, + account_id: str, resolution: Literal["desktop", "mobile", "tablet"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -596,8 +584,6 @@ def screenshot( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -641,7 +627,7 @@ def with_streaming_response(self) -> AsyncScansResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, url: str, agent_readiness: bool | Omit = omit, country: Literal[ @@ -884,8 +870,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -912,7 +896,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_id: str, q: str | Omit = omit, size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -948,8 +932,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -973,7 +955,7 @@ async def list( async def bulk_create( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[scan_bulk_create_params.Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1002,8 +984,6 @@ async def bulk_create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -1019,7 +999,7 @@ async def dom( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -1044,8 +1024,6 @@ async def dom( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -1063,7 +1041,7 @@ async def get( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -1087,8 +1065,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -1107,7 +1083,7 @@ async def har( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -1133,8 +1109,6 @@ async def har( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -1151,7 +1125,7 @@ async def screenshot( self, scan_id: str, *, - account_id: str | None = None, + account_id: str, resolution: Literal["desktop", "mobile", "tablet"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1178,8 +1152,6 @@ async def screenshot( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: diff --git a/src/cloudflare/resources/vectorize/indexes/indexes.py b/src/cloudflare/resources/vectorize/indexes/indexes.py index da0af709019..d84f200ed70 100644 --- a/src/cloudflare/resources/vectorize/indexes/indexes.py +++ b/src/cloudflare/resources/vectorize/indexes/indexes.py @@ -86,7 +86,7 @@ def with_streaming_response(self) -> IndexesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, config: index_create_params.Config, name: str, description: str | Omit = omit, @@ -115,8 +115,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -142,7 +140,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -164,8 +162,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -181,7 +177,7 @@ def delete( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -203,8 +199,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -234,7 +228,7 @@ def delete_by_ids( self, index_name: str, *, - account_id: str | None = None, + account_id: str, ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -259,8 +253,6 @@ def delete_by_ids( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -286,7 +278,7 @@ def get( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -308,8 +300,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -332,7 +322,7 @@ def get_by_ids( self, index_name: str, *, - account_id: str | None = None, + account_id: str, ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -357,8 +347,6 @@ def get_by_ids( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -384,7 +372,7 @@ def info( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -406,8 +394,6 @@ def info( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -432,7 +418,7 @@ def insert( self, index_name: str, *, - account_id: str | None = None, + account_id: str, body: FileTypes, unparsable_behavior: Literal["error", "discard"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -461,8 +447,6 @@ def insert( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -491,7 +475,7 @@ def list_vectors( self, index_name: str, *, - account_id: str | None = None, + account_id: str, count: int | Omit = omit, cursor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -519,8 +503,6 @@ def list_vectors( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -552,7 +534,7 @@ def query( self, index_name: str, *, - account_id: str | None = None, + account_id: str, vector: Iterable[float], filter: object | Omit = omit, return_metadata: Literal["none", "indexed", "all"] | Omit = omit, @@ -590,8 +572,6 @@ def query( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -626,7 +606,7 @@ def upsert( self, index_name: str, *, - account_id: str | None = None, + account_id: str, body: FileTypes, unparsable_behavior: Literal["error", "discard"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -655,8 +635,6 @@ def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -709,7 +687,7 @@ def with_streaming_response(self) -> AsyncIndexesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, config: index_create_params.Config, name: str, description: str | Omit = omit, @@ -738,8 +716,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -765,7 +741,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -787,8 +763,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -804,7 +778,7 @@ async def delete( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -826,8 +800,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -857,7 +829,7 @@ async def delete_by_ids( self, index_name: str, *, - account_id: str | None = None, + account_id: str, ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -882,8 +854,6 @@ async def delete_by_ids( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -909,7 +879,7 @@ async def get( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -931,8 +901,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -955,7 +923,7 @@ async def get_by_ids( self, index_name: str, *, - account_id: str | None = None, + account_id: str, ids: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -980,8 +948,6 @@ async def get_by_ids( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -1007,7 +973,7 @@ async def info( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -1029,8 +995,6 @@ async def info( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -1055,7 +1019,7 @@ async def insert( self, index_name: str, *, - account_id: str | None = None, + account_id: str, body: FileTypes, unparsable_behavior: Literal["error", "discard"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1084,8 +1048,6 @@ async def insert( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -1114,7 +1076,7 @@ async def list_vectors( self, index_name: str, *, - account_id: str | None = None, + account_id: str, count: int | Omit = omit, cursor: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1142,8 +1104,6 @@ async def list_vectors( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -1175,7 +1135,7 @@ async def query( self, index_name: str, *, - account_id: str | None = None, + account_id: str, vector: Iterable[float], filter: object | Omit = omit, return_metadata: Literal["none", "indexed", "all"] | Omit = omit, @@ -1213,8 +1173,6 @@ async def query( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -1249,7 +1207,7 @@ async def upsert( self, index_name: str, *, - account_id: str | None = None, + account_id: str, body: FileTypes, unparsable_behavior: Literal["error", "discard"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1278,8 +1236,6 @@ async def upsert( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: diff --git a/src/cloudflare/resources/vectorize/indexes/metadata_index.py b/src/cloudflare/resources/vectorize/indexes/metadata_index.py index fac9023ca9c..e011a20331d 100644 --- a/src/cloudflare/resources/vectorize/indexes/metadata_index.py +++ b/src/cloudflare/resources/vectorize/indexes/metadata_index.py @@ -51,7 +51,7 @@ def create( self, index_name: str, *, - account_id: str | None = None, + account_id: str, index_type: Literal["string", "number", "boolean"], property_name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -113,7 +111,7 @@ def list( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -135,8 +133,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -161,7 +157,7 @@ def delete( self, index_name: str, *, - account_id: str | None = None, + account_id: str, property_name: 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. @@ -186,8 +182,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -236,7 +230,7 @@ async def create( self, index_name: str, *, - account_id: str | None = None, + account_id: str, index_type: Literal["string", "number", "boolean"], property_name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -265,8 +259,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -298,7 +290,7 @@ async def list( self, index_name: str, *, - account_id: str | None = None, + account_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, @@ -320,8 +312,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: @@ -346,7 +336,7 @@ async def delete( self, index_name: str, *, - account_id: str | None = None, + account_id: str, property_name: 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. @@ -371,8 +361,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not index_name: diff --git a/src/cloudflare/resources/vulnerability_scanner/credential_sets/credential_sets.py b/src/cloudflare/resources/vulnerability_scanner/credential_sets/credential_sets.py index 1348324570f..c1c6fb81e74 100644 --- a/src/cloudflare/resources/vulnerability_scanner/credential_sets/credential_sets.py +++ b/src/cloudflare/resources/vulnerability_scanner/credential_sets/credential_sets.py @@ -69,7 +69,7 @@ def with_streaming_response(self) -> CredentialSetsResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -115,7 +113,7 @@ def update( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -141,8 +139,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -167,7 +163,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -195,8 +191,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -222,7 +216,7 @@ def delete( self, credential_set_id: str, *, - account_id: str | None = None, + account_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, @@ -244,8 +238,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -270,7 +262,7 @@ def edit( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -296,8 +288,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -323,7 +313,7 @@ def get( self, credential_set_id: str, *, - account_id: str | None = None, + account_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, @@ -345,8 +335,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -395,7 +383,7 @@ def with_streaming_response(self) -> AsyncCredentialSetsResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -420,8 +408,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -441,7 +427,7 @@ async def update( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -467,8 +453,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -493,7 +477,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -521,8 +505,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -548,7 +530,7 @@ async def delete( self, credential_set_id: str, *, - account_id: str | None = None, + account_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, @@ -570,8 +552,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -596,7 +576,7 @@ async def edit( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -622,8 +602,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -649,7 +627,7 @@ async def get( self, credential_set_id: str, *, - account_id: str | None = None, + account_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, @@ -671,8 +649,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: diff --git a/src/cloudflare/resources/vulnerability_scanner/credential_sets/credentials.py b/src/cloudflare/resources/vulnerability_scanner/credential_sets/credentials.py index f615dbd8ad6..1d83826dc0b 100644 --- a/src/cloudflare/resources/vulnerability_scanner/credential_sets/credentials.py +++ b/src/cloudflare/resources/vulnerability_scanner/credential_sets/credentials.py @@ -59,7 +59,7 @@ def create( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, location: Literal["header", "cookie"], location_name: str, name: str, @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -129,7 +127,7 @@ def update( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_id: str, location: Literal["header", "cookie"], location_name: str, @@ -165,8 +163,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -203,7 +199,7 @@ def list( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -231,8 +227,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -264,7 +258,7 @@ def delete( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_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. @@ -287,8 +281,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -316,7 +308,7 @@ def edit( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_id: str, location: Literal["header", "cookie"] | Omit = omit, location_name: str | Omit = omit, @@ -352,8 +344,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -390,7 +380,7 @@ def get( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_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. @@ -413,8 +403,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -463,7 +451,7 @@ async def create( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, location: Literal["header", "cookie"], location_name: str, name: str, @@ -498,8 +486,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -533,7 +519,7 @@ async def update( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_id: str, location: Literal["header", "cookie"], location_name: str, @@ -569,8 +555,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -607,7 +591,7 @@ def list( self, credential_set_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -635,8 +619,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -668,7 +650,7 @@ async def delete( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_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. @@ -691,8 +673,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -720,7 +700,7 @@ async def edit( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_id: str, location: Literal["header", "cookie"] | Omit = omit, location_name: str | Omit = omit, @@ -756,8 +736,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: @@ -794,7 +772,7 @@ async def get( self, credential_id: str, *, - account_id: str | None = None, + account_id: str, credential_set_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. @@ -817,8 +795,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not credential_set_id: diff --git a/src/cloudflare/resources/vulnerability_scanner/scans.py b/src/cloudflare/resources/vulnerability_scanner/scans.py index 2c51c596530..9643268c567 100644 --- a/src/cloudflare/resources/vulnerability_scanner/scans.py +++ b/src/cloudflare/resources/vulnerability_scanner/scans.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> ScansResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, credential_sets: scan_create_params.CredentialSets, openapi: str, scan_type: Literal["bola"], @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -116,7 +114,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -144,8 +142,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -171,7 +167,7 @@ def get( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -193,8 +189,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: @@ -237,7 +231,7 @@ def with_streaming_response(self) -> AsyncScansResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, credential_sets: scan_create_params.CredentialSets, openapi: str, scan_type: Literal["bola"], @@ -274,8 +268,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -302,7 +294,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -330,8 +322,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -357,7 +347,7 @@ async def get( self, scan_id: str, *, - account_id: str | None = None, + account_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, @@ -379,8 +369,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not scan_id: diff --git a/src/cloudflare/resources/vulnerability_scanner/target_environments.py b/src/cloudflare/resources/vulnerability_scanner/target_environments.py index 28b25b0bab7..049ad09157d 100644 --- a/src/cloudflare/resources/vulnerability_scanner/target_environments.py +++ b/src/cloudflare/resources/vulnerability_scanner/target_environments.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> TargetEnvironmentsResourceWithStreamingResp def create( self, *, - account_id: str | None = None, + account_id: str, name: str, target: target_environment_create_params.Target, description: Optional[str] | Omit = omit, @@ -89,8 +89,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -119,7 +117,7 @@ def update( self, target_environment_id: str, *, - account_id: str | None = None, + account_id: str, name: str, target: target_environment_update_params.Target, description: Optional[str] | Omit = omit, @@ -152,8 +150,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -189,7 +185,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -217,8 +213,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -244,7 +238,7 @@ def delete( self, target_environment_id: str, *, - account_id: str | None = None, + account_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, @@ -266,8 +260,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -294,7 +286,7 @@ def edit( self, target_environment_id: str, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, name: str | Omit = omit, target: target_environment_edit_params.Target | Omit = omit, @@ -328,8 +320,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -364,7 +354,7 @@ def get( self, target_environment_id: str, *, - account_id: str | None = None, + account_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, @@ -386,8 +376,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -434,7 +422,7 @@ def with_streaming_response(self) -> AsyncTargetEnvironmentsResourceWithStreamin async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, target: target_environment_create_params.Target, description: Optional[str] | Omit = omit, @@ -466,8 +454,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -496,7 +482,7 @@ async def update( self, target_environment_id: str, *, - account_id: str | None = None, + account_id: str, name: str, target: target_environment_update_params.Target, description: Optional[str] | Omit = omit, @@ -529,8 +515,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -566,7 +550,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -594,8 +578,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -621,7 +603,7 @@ async def delete( self, target_environment_id: str, *, - account_id: str | None = None, + account_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, @@ -643,8 +625,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -671,7 +651,7 @@ async def edit( self, target_environment_id: str, *, - account_id: str | None = None, + account_id: str, description: Optional[str] | Omit = omit, name: str | Omit = omit, target: target_environment_edit_params.Target | Omit = omit, @@ -705,8 +685,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: @@ -741,7 +719,7 @@ async def get( self, target_environment_id: str, *, - account_id: str | None = None, + account_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, @@ -763,8 +741,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_environment_id: diff --git a/src/cloudflare/resources/waiting_rooms/events/details.py b/src/cloudflare/resources/waiting_rooms/events/details.py index d21c5cd670d..1b44733acf9 100644 --- a/src/cloudflare/resources/waiting_rooms/events/details.py +++ b/src/cloudflare/resources/waiting_rooms/events/details.py @@ -47,7 +47,7 @@ def get( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -122,7 +120,7 @@ async def get( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -147,8 +145,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: diff --git a/src/cloudflare/resources/waiting_rooms/events/events.py b/src/cloudflare/resources/waiting_rooms/events/events.py index f6c82500281..02225ec2ab6 100644 --- a/src/cloudflare/resources/waiting_rooms/events/events.py +++ b/src/cloudflare/resources/waiting_rooms/events/events.py @@ -63,7 +63,7 @@ def create( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, event_end_time: str, event_start_time: str, name: str, @@ -158,8 +158,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -204,7 +202,7 @@ def update( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, event_end_time: str, event_start_time: str, @@ -294,8 +292,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -343,7 +339,7 @@ def list( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -371,8 +367,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -404,7 +398,7 @@ def delete( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -427,8 +421,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -456,7 +448,7 @@ def edit( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, event_end_time: str, event_start_time: str, @@ -546,8 +538,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -595,7 +585,7 @@ def get( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -618,8 +608,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -672,7 +660,7 @@ async def create( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, event_end_time: str, event_start_time: str, name: str, @@ -767,8 +755,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -813,7 +799,7 @@ async def update( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, event_end_time: str, event_start_time: str, @@ -903,8 +889,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -952,7 +936,7 @@ def list( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -980,8 +964,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1013,7 +995,7 @@ async def delete( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -1036,8 +1018,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1065,7 +1045,7 @@ async def edit( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, event_end_time: str, event_start_time: str, @@ -1155,8 +1135,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1204,7 +1182,7 @@ async def get( self, event_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -1227,8 +1205,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: diff --git a/src/cloudflare/resources/waiting_rooms/page.py b/src/cloudflare/resources/waiting_rooms/page.py index be00a540b69..0f37d2ad698 100644 --- a/src/cloudflare/resources/waiting_rooms/page.py +++ b/src/cloudflare/resources/waiting_rooms/page.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PageResourceWithStreamingResponse: def preview( self, *, - zone_id: str | None = None, + zone_id: str, custom_html: 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. @@ -128,8 +128,6 @@ def preview( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -169,7 +167,7 @@ def with_streaming_response(self) -> AsyncPageResourceWithStreamingResponse: async def preview( self, *, - zone_id: str | None = None, + zone_id: str, custom_html: 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. @@ -250,8 +248,6 @@ async def preview( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( diff --git a/src/cloudflare/resources/waiting_rooms/rules.py b/src/cloudflare/resources/waiting_rooms/rules.py index 7d2696c7f56..ceb7e3679fb 100644 --- a/src/cloudflare/resources/waiting_rooms/rules.py +++ b/src/cloudflare/resources/waiting_rooms/rules.py @@ -49,7 +49,7 @@ def create( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, rules: rule_create_params.Rules, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -99,7 +97,7 @@ def update( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -124,8 +122,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -149,7 +145,7 @@ def delete( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -174,8 +170,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -201,7 +195,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, action: Literal["bypass_waiting_room"], expression: str, @@ -241,8 +235,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -278,7 +270,7 @@ def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -300,8 +292,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -344,7 +334,7 @@ def create( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, rules: rule_create_params.Rules, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -369,8 +359,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -394,7 +382,7 @@ def update( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, rules: Iterable[rule_update_params.Rule], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -419,8 +407,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -444,7 +430,7 @@ def delete( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_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. @@ -469,8 +455,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -496,7 +480,7 @@ def edit( self, rule_id: str, *, - zone_id: str | None = None, + zone_id: str, waiting_room_id: str, action: Literal["bypass_waiting_room"], expression: str, @@ -536,8 +520,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -573,7 +555,7 @@ def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -595,8 +577,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: diff --git a/src/cloudflare/resources/waiting_rooms/settings.py b/src/cloudflare/resources/waiting_rooms/settings.py index d56033ad9d6..f3f3c901cb5 100644 --- a/src/cloudflare/resources/waiting_rooms/settings.py +++ b/src/cloudflare/resources/waiting_rooms/settings.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, search_engine_crawler_bypass: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -100,7 +98,7 @@ def update( def edit( self, *, - zone_id: str | None = None, + zone_id: str, search_engine_crawler_bypass: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,8 +125,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -149,7 +145,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -172,8 +168,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -212,7 +206,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, search_engine_crawler_bypass: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -240,8 +234,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -263,7 +255,7 @@ async def update( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, search_engine_crawler_bypass: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -290,8 +282,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -312,7 +302,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -335,8 +325,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/waiting_rooms/statuses.py b/src/cloudflare/resources/waiting_rooms/statuses.py index cc1eaf2b910..78ff33c1264 100644 --- a/src/cloudflare/resources/waiting_rooms/statuses.py +++ b/src/cloudflare/resources/waiting_rooms/statuses.py @@ -47,7 +47,7 @@ def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -88,8 +88,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -135,7 +133,7 @@ async def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -176,8 +174,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: diff --git a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py index 49ccbc48dd3..918bcedd125 100644 --- a/src/cloudflare/resources/waiting_rooms/waiting_rooms.py +++ b/src/cloudflare/resources/waiting_rooms/waiting_rooms.py @@ -117,7 +117,7 @@ def with_streaming_response(self) -> WaitingRoomsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -475,8 +475,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -521,7 +519,7 @@ def update( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -879,8 +877,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -928,8 +924,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -959,10 +955,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1002,7 +994,7 @@ def delete( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -1024,8 +1016,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1048,7 +1038,7 @@ def edit( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -1406,8 +1396,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1456,7 +1444,7 @@ def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -1478,8 +1466,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -1542,7 +1528,7 @@ def with_streaming_response(self) -> AsyncWaitingRoomsResourceWithStreamingRespo async def create( self, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -1900,8 +1886,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -1946,7 +1930,7 @@ async def update( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -2304,8 +2288,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -2353,8 +2335,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2384,10 +2366,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -2427,7 +2405,7 @@ async def delete( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -2449,8 +2427,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -2473,7 +2449,7 @@ async def edit( self, waiting_room_id: str, *, - zone_id: str | None = None, + zone_id: str, host: str, name: str, new_users_per_minute: int, @@ -2831,8 +2807,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: @@ -2881,7 +2855,7 @@ async def get( self, waiting_room_id: str, *, - zone_id: str | None = None, + 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, @@ -2903,8 +2877,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not waiting_room_id: diff --git a/src/cloudflare/resources/web3/hostnames/hostnames.py b/src/cloudflare/resources/web3/hostnames/hostnames.py index 0f57d24f757..8df65deba70 100644 --- a/src/cloudflare/resources/web3/hostnames/hostnames.py +++ b/src/cloudflare/resources/web3/hostnames/hostnames.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> HostnamesResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, name: str, target: Literal["ethereum", "ipfs", "ipfs_universal_path"], description: str | Omit = omit, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -124,7 +122,7 @@ def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -146,8 +144,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -163,7 +159,7 @@ def delete( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -187,8 +183,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -209,7 +203,7 @@ def edit( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, dnslink: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -239,8 +233,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -268,7 +260,7 @@ def get( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -292,8 +284,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -338,7 +328,7 @@ def with_streaming_response(self) -> AsyncHostnamesResourceWithStreamingResponse async def create( self, *, - zone_id: str | None = None, + zone_id: str, name: str, target: Literal["ethereum", "ipfs", "ipfs_universal_path"], description: str | Omit = omit, @@ -372,8 +362,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -400,7 +388,7 @@ async def create( def list( self, *, - zone_id: str | None = None, + 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, @@ -422,8 +410,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -439,7 +425,7 @@ async def delete( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -463,8 +449,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -485,7 +469,7 @@ async def edit( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, description: str | Omit = omit, dnslink: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -515,8 +499,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -544,7 +526,7 @@ async def get( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -568,8 +550,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py index e48830f7105..ccb04acda40 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/content_lists.py @@ -61,7 +61,7 @@ def update( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["block"], entries: Iterable[content_list_update_params.Entry], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -91,8 +91,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -124,7 +122,7 @@ def get( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -148,8 +146,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -199,7 +195,7 @@ async def update( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, action: Literal["block"], entries: Iterable[content_list_update_params.Entry], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -229,8 +225,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -262,7 +256,7 @@ async def get( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -286,8 +280,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: diff --git a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py index 24e4aa7a6f8..30bb1e24097 100644 --- a/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py +++ b/src/cloudflare/resources/web3/hostnames/ipfs_universal_paths/content_lists/entries.py @@ -53,7 +53,7 @@ def create( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, content: str, type: Literal["cid", "content_path"], description: str | Omit = omit, @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -120,7 +118,7 @@ def update( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: str, content: str, type: Literal["cid", "content_path"], @@ -156,8 +154,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -195,7 +191,7 @@ def list( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -219,8 +215,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -245,7 +239,7 @@ def delete( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: 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. @@ -272,8 +266,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -303,7 +295,7 @@ def get( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: 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. @@ -330,8 +322,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -382,7 +372,7 @@ async def create( self, identifier: str, *, - zone_id: str | None = None, + zone_id: str, content: str, type: Literal["cid", "content_path"], description: str | Omit = omit, @@ -415,8 +405,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -449,7 +437,7 @@ async def update( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: str, content: str, type: Literal["cid", "content_path"], @@ -485,8 +473,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -524,7 +510,7 @@ async def list( self, identifier: str, *, - zone_id: str | None = None, + 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, @@ -548,8 +534,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -574,7 +558,7 @@ async def delete( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: 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. @@ -601,8 +585,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: @@ -632,7 +614,7 @@ async def get( self, content_list_entry_identifier: str, *, - zone_id: str | None = None, + zone_id: str, identifier: 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. @@ -659,8 +641,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not identifier: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py index d75ba29f9e8..a5aba849ba0 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/namespaces.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> NamespacesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,8 +87,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -129,8 +127,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -146,7 +142,7 @@ def delete( self, dispatch_namespace: str, *, - account_id: str | None = None, + account_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, @@ -170,8 +166,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -196,7 +190,7 @@ def get( self, dispatch_namespace: str, *, - account_id: str | None = None, + account_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, @@ -220,8 +214,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -270,7 +262,7 @@ def with_streaming_response(self) -> AsyncNamespacesResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -295,8 +287,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -315,7 +305,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -337,8 +327,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -354,7 +342,7 @@ async def delete( self, dispatch_namespace: str, *, - account_id: str | None = None, + account_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, @@ -378,8 +366,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -404,7 +390,7 @@ async def get( self, dispatch_namespace: str, *, - account_id: str | None = None, + account_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, @@ -428,8 +414,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py index 3a27bfc5b07..2c306c686b7 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/asset_upload.py @@ -50,7 +50,7 @@ def create( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, manifest: Dict[str, asset_upload_create_params.Manifest], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -135,7 +133,7 @@ async def create( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, manifest: Dict[str, asset_upload_create_params.Manifest], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -169,8 +167,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py index fb2456fe9ea..9239fd4f629 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/bindings.py @@ -47,7 +47,7 @@ def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -75,8 +75,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -122,7 +120,7 @@ def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -150,8 +148,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py index 1c51a0e8fd1..dd64f433a7f 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/content.py @@ -74,7 +74,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, metadata: WorkerMetadataParam, files: SequenceNotStr[FileTypes] | Omit = omit, @@ -115,8 +115,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -167,7 +165,7 @@ def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -195,8 +193,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -242,7 +238,7 @@ async def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, metadata: WorkerMetadataParam, files: SequenceNotStr[FileTypes] | Omit = omit, @@ -283,8 +279,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -335,7 +329,7 @@ async def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -363,8 +357,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: 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 8d9e207024b..73a432080cb 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 @@ -132,7 +132,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, bindings_inherit: Literal["strict"] | Omit = omit, @@ -179,8 +179,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -223,7 +221,7 @@ def delete( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -257,8 +255,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -287,7 +283,7 @@ def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -314,8 +310,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -388,7 +382,7 @@ async def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, bindings_inherit: Literal["strict"] | Omit = omit, @@ -435,8 +429,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -481,7 +473,7 @@ async def delete( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, force: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -515,8 +507,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -545,7 +535,7 @@ async def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -572,8 +562,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py index 867c48fcd92..7a836558f31 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/secrets.py @@ -57,7 +57,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, name: str, text: str, @@ -100,7 +100,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, algorithm: object, format: Literal["raw", "pkcs8", "spki", "jwk"], @@ -158,14 +158,14 @@ def update( ... @required_args( - ["dispatch_namespace", "name", "text", "type"], - ["dispatch_namespace", "algorithm", "format", "name", "type", "usages"], + ["account_id", "dispatch_namespace", "name", "text", "type"], + ["account_id", "dispatch_namespace", "algorithm", "format", "name", "type", "usages"], ) def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, name: str, text: str | Omit = omit, @@ -183,8 +183,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -230,7 +228,7 @@ def list( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -257,8 +255,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -283,7 +279,7 @@ def delete( self, secret_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, url_encoded: bool | Omit = omit, @@ -316,8 +312,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -349,7 +343,7 @@ def get( self, secret_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, url_encoded: bool | Omit = omit, @@ -383,8 +377,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -443,7 +435,7 @@ async def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, name: str, text: str, @@ -486,7 +478,7 @@ async def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, algorithm: object, format: Literal["raw", "pkcs8", "spki", "jwk"], @@ -544,14 +536,14 @@ async def update( ... @required_args( - ["dispatch_namespace", "name", "text", "type"], - ["dispatch_namespace", "algorithm", "format", "name", "type", "usages"], + ["account_id", "dispatch_namespace", "name", "text", "type"], + ["account_id", "dispatch_namespace", "algorithm", "format", "name", "type", "usages"], ) async def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, name: str, text: str | Omit = omit, @@ -569,8 +561,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretUpdateResponse: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -616,7 +606,7 @@ def list( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -643,8 +633,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -669,7 +657,7 @@ async def delete( self, secret_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, url_encoded: bool | Omit = omit, @@ -702,8 +690,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -737,7 +723,7 @@ async def get( self, secret_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, url_encoded: bool | Omit = omit, @@ -771,8 +757,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py index 448188925a2..83f3820c51f 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py @@ -49,7 +49,7 @@ def edit( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, settings: setting_edit_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -81,8 +81,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -116,7 +114,7 @@ def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -143,8 +141,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -193,7 +189,7 @@ async def edit( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, settings: setting_edit_params.Settings | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -225,8 +221,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -260,7 +254,7 @@ async def get( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -287,8 +281,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py index 3a5d2114360..f452276f929 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/tags.py @@ -49,7 +49,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, body: Optional[SequenceNotStr[str]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -107,7 +105,7 @@ def list( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -134,8 +132,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -160,7 +156,7 @@ def delete( self, tag: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -188,8 +184,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -241,7 +235,7 @@ def update( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, body: Optional[SequenceNotStr[str]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -271,8 +265,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -299,7 +291,7 @@ def list( self, script_name: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: 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. @@ -326,8 +318,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: @@ -352,7 +342,7 @@ async def delete( self, tag: str, *, - account_id: str | None = None, + account_id: str, dispatch_namespace: str, script_name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -380,8 +370,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dispatch_namespace: diff --git a/src/cloudflare/resources/workflows/instances/events.py b/src/cloudflare/resources/workflows/instances/events.py index ec6c023ec3c..8e90369159d 100644 --- a/src/cloudflare/resources/workflows/instances/events.py +++ b/src/cloudflare/resources/workflows/instances/events.py @@ -47,7 +47,7 @@ def create( self, event_type: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, instance_id: str, body: object | Omit = omit, @@ -70,8 +70,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -124,7 +122,7 @@ async def create( self, event_type: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, instance_id: str, body: object | Omit = omit, @@ -147,8 +145,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: diff --git a/src/cloudflare/resources/workflows/instances/instances.py b/src/cloudflare/resources/workflows/instances/instances.py index 9de456c03ba..7ca893ccad4 100644 --- a/src/cloudflare/resources/workflows/instances/instances.py +++ b/src/cloudflare/resources/workflows/instances/instances.py @@ -78,7 +78,7 @@ def create( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, instance_id: str | Omit = omit, instance_retention: instance_create_params.InstanceRetention | Omit = omit, params: object | Omit = omit, @@ -101,8 +101,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -135,7 +133,7 @@ def list( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, date_end: Union[str, datetime] | Omit = omit, date_start: Union[str, datetime] | Omit = omit, @@ -175,8 +173,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -213,7 +209,7 @@ def bulk( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[instance_bulk_params.Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -234,8 +230,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -259,7 +253,7 @@ def get( self, instance_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, order: Literal["asc", "desc"] | Omit = omit, simple: Literal["true", "false"] | Omit = omit, @@ -286,8 +280,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -351,7 +343,7 @@ async def create( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, instance_id: str | Omit = omit, instance_retention: instance_create_params.InstanceRetention | Omit = omit, params: object | Omit = omit, @@ -374,8 +366,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -408,7 +398,7 @@ def list( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, cursor: str | Omit = omit, date_end: Union[str, datetime] | Omit = omit, date_start: Union[str, datetime] | Omit = omit, @@ -448,8 +438,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -486,7 +474,7 @@ def bulk( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[instance_bulk_params.Body] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -507,8 +495,6 @@ def bulk( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -532,7 +518,7 @@ async def get( self, instance_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, order: Literal["asc", "desc"] | Omit = omit, simple: Literal["true", "false"] | Omit = omit, @@ -559,8 +545,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: diff --git a/src/cloudflare/resources/workflows/instances/status.py b/src/cloudflare/resources/workflows/instances/status.py index eb3b52525f0..eb1780498b6 100644 --- a/src/cloudflare/resources/workflows/instances/status.py +++ b/src/cloudflare/resources/workflows/instances/status.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Query, Headers, NotGiven, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import path_template, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -49,9 +49,10 @@ def edit( self, instance_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, status: Literal["resume", "pause", "terminate", "restart"], + from_: status_edit_params.From | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -66,6 +67,8 @@ def edit( Args: status: Apply action to instance. + from_: Step to restart from. Only applicable when status is "restart". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -74,8 +77,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -89,7 +90,13 @@ def edit( workflow_name=workflow_name, instance_id=instance_id, ), - body=maybe_transform({"status": status}, status_edit_params.StatusEditParams), + body=maybe_transform( + { + "status": status, + "from_": from_, + }, + status_edit_params.StatusEditParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -125,9 +132,10 @@ async def edit( self, instance_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: str, status: Literal["resume", "pause", "terminate", "restart"], + from_: status_edit_params.From | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -142,6 +150,8 @@ async def edit( Args: status: Apply action to instance. + from_: Step to restart from. Only applicable when status is "restart". + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -150,8 +160,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -165,7 +173,13 @@ async def edit( workflow_name=workflow_name, instance_id=instance_id, ), - body=await async_maybe_transform({"status": status}, status_edit_params.StatusEditParams), + body=await async_maybe_transform( + { + "status": status, + "from_": from_, + }, + status_edit_params.StatusEditParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/workflows/versions.py b/src/cloudflare/resources/workflows/versions.py index 79434869d64..b702774c237 100644 --- a/src/cloudflare/resources/workflows/versions.py +++ b/src/cloudflare/resources/workflows/versions.py @@ -50,7 +50,7 @@ def list( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -72,8 +72,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -105,7 +103,7 @@ def get( self, version_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: 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. @@ -126,8 +124,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -176,7 +172,7 @@ def list( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -198,8 +194,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -231,7 +225,7 @@ async def get( self, version_id: str, *, - account_id: str | None = None, + account_id: str, workflow_name: 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. @@ -252,8 +246,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: diff --git a/src/cloudflare/resources/workflows/workflows.py b/src/cloudflare/resources/workflows/workflows.py index 02d76468b2f..803e81f301d 100644 --- a/src/cloudflare/resources/workflows/workflows.py +++ b/src/cloudflare/resources/workflows/workflows.py @@ -76,7 +76,7 @@ def update( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, class_name: str, script_name: str, limits: workflow_update_params.Limits | Omit = omit, @@ -99,8 +99,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -130,7 +128,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, search: str | Omit = omit, @@ -155,8 +153,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -183,7 +179,7 @@ def delete( self, workflow_name: str, *, - account_id: str | None = None, + account_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, @@ -205,8 +201,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -229,7 +223,7 @@ def get( self, workflow_name: str, *, - account_id: str | None = None, + account_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, @@ -249,8 +243,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -302,7 +294,7 @@ async def update( self, workflow_name: str, *, - account_id: str | None = None, + account_id: str, class_name: str, script_name: str, limits: workflow_update_params.Limits | Omit = omit, @@ -325,8 +317,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -356,7 +346,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: float | Omit = omit, per_page: float | Omit = omit, search: str | Omit = omit, @@ -381,8 +371,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -409,7 +397,7 @@ async def delete( self, workflow_name: str, *, - account_id: str | None = None, + account_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, @@ -431,8 +419,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: @@ -455,7 +441,7 @@ async def get( self, workflow_name: str, *, - account_id: str | None = None, + account_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, @@ -475,8 +461,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not workflow_name: diff --git a/src/cloudflare/resources/zaraz/config.py b/src/cloudflare/resources/zaraz/config.py index feee007e472..829fca458ba 100644 --- a/src/cloudflare/resources/zaraz/config.py +++ b/src/cloudflare/resources/zaraz/config.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, data_layer: bool, debug_key: str, settings: config_update_params.Settings, @@ -103,8 +103,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -137,7 +135,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -162,8 +160,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -202,7 +198,7 @@ def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, data_layer: bool, debug_key: str, settings: config_update_params.Settings, @@ -258,8 +254,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -292,7 +286,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -317,8 +311,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zaraz/default.py b/src/cloudflare/resources/zaraz/default.py index c97fa58cf63..4a65532e004 100644 --- a/src/cloudflare/resources/zaraz/default.py +++ b/src/cloudflare/resources/zaraz/default.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> DefaultResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncDefaultResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -130,8 +128,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zaraz/export.py b/src/cloudflare/resources/zaraz/export.py index 18734c3dcbd..27e26f55d21 100644 --- a/src/cloudflare/resources/zaraz/export.py +++ b/src/cloudflare/resources/zaraz/export.py @@ -43,7 +43,7 @@ def with_streaming_response(self) -> ExportResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -66,8 +66,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -102,7 +100,7 @@ def with_streaming_response(self) -> AsyncExportResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -125,8 +123,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zaraz/history/configs.py b/src/cloudflare/resources/zaraz/history/configs.py index 2919d870f18..9ff5276221e 100644 --- a/src/cloudflare/resources/zaraz/history/configs.py +++ b/src/cloudflare/resources/zaraz/history/configs.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + zone_id: str, ids: Iterable[int], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + zone_id: str, ids: Iterable[int], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zaraz/history/history.py b/src/cloudflare/resources/zaraz/history/history.py index 13e3a95d46a..95073d3788b 100644 --- a/src/cloudflare/resources/zaraz/history/history.py +++ b/src/cloudflare/resources/zaraz/history/history.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> HistoryResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, body: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,8 +87,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -107,7 +105,7 @@ def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | Omit = omit, @@ -141,8 +139,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -194,7 +190,7 @@ def with_streaming_response(self) -> AsyncHistoryResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, body: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -219,8 +215,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -239,7 +233,7 @@ async def update( def list( self, *, - zone_id: str | None = None, + zone_id: str, limit: int | Omit = omit, offset: int | Omit = omit, sort_field: Literal["id", "user_id", "description", "created_at", "updated_at"] | Omit = omit, @@ -273,8 +267,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/zaraz/publish.py b/src/cloudflare/resources/zaraz/publish.py index 9681688e0c0..43732b388ab 100644 --- a/src/cloudflare/resources/zaraz/publish.py +++ b/src/cloudflare/resources/zaraz/publish.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PublishResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, body: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -113,7 +111,7 @@ def with_streaming_response(self) -> AsyncPublishResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, body: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,8 +136,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( diff --git a/src/cloudflare/resources/zaraz/workflow.py b/src/cloudflare/resources/zaraz/workflow.py index d5680f56c07..4e3866b388f 100644 --- a/src/cloudflare/resources/zaraz/workflow.py +++ b/src/cloudflare/resources/zaraz/workflow.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> WorkflowResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -68,8 +68,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -110,7 +108,7 @@ def with_streaming_response(self) -> AsyncWorkflowResourceWithStreamingResponse: async def get( self, *, - zone_id: str | None = None, + 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, @@ -132,8 +130,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zaraz/zaraz.py b/src/cloudflare/resources/zaraz/zaraz.py index efbe0454406..d2c35b1eaee 100644 --- a/src/cloudflare/resources/zaraz/zaraz.py +++ b/src/cloudflare/resources/zaraz/zaraz.py @@ -119,7 +119,7 @@ def with_streaming_response(self) -> ZarazResourceWithStreamingResponse: def update( self, *, - zone_id: str | None = None, + zone_id: str, workflow: Workflow, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -144,8 +144,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -211,7 +209,7 @@ def with_streaming_response(self) -> AsyncZarazResourceWithStreamingResponse: async def update( self, *, - zone_id: str | None = None, + zone_id: str, workflow: Workflow, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -236,8 +234,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( diff --git a/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/portals.py b/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/portals.py index 5f2484327fa..656aa6e574d 100644 --- a/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/portals.py +++ b/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/portals.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> PortalsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, hostname: str, name: str, @@ -85,8 +85,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -117,7 +115,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, allow_code_mode: bool | Omit = omit, description: str | Omit = omit, hostname: str | Omit = omit, @@ -149,8 +147,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -181,7 +177,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -206,8 +202,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -234,7 +228,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -256,8 +250,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -278,7 +270,7 @@ def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -300,8 +292,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -342,7 +332,7 @@ def with_streaming_response(self) -> AsyncPortalsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, hostname: str, name: str, @@ -375,8 +365,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -407,7 +395,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, allow_code_mode: bool | Omit = omit, description: str | Omit = omit, hostname: str | Omit = omit, @@ -439,8 +427,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -471,7 +457,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -496,8 +482,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -524,7 +508,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -546,8 +530,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -568,7 +550,7 @@ async def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -590,8 +572,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/servers.py b/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/servers.py index 74006087ff9..c62fa0a83c9 100644 --- a/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/servers.py +++ b/src/cloudflare/resources/zero_trust/access/ai_controls/mcp/servers.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> ServersResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, id: str, auth_type: Literal["oauth", "bearer", "unauthenticated"], hostname: str, @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -116,7 +114,7 @@ def update( self, id: str, *, - account_id: str | None = None, + account_id: str, auth_credentials: str | Omit = omit, description: Optional[str] | Omit = omit, name: str | Omit = omit, @@ -143,8 +141,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -174,7 +170,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -199,8 +195,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -227,7 +221,7 @@ def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -249,8 +243,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -271,7 +263,7 @@ def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -293,8 +285,6 @@ def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -315,7 +305,7 @@ def sync( self, id: str, *, - account_id: str | None = None, + account_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, @@ -337,8 +327,6 @@ def sync( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -381,7 +369,7 @@ def with_streaming_response(self) -> AsyncServersResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, id: str, auth_type: Literal["oauth", "bearer", "unauthenticated"], hostname: str, @@ -411,8 +399,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -444,7 +430,7 @@ async def update( self, id: str, *, - account_id: str | None = None, + account_id: str, auth_credentials: str | Omit = omit, description: Optional[str] | Omit = omit, name: str | Omit = omit, @@ -471,8 +457,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -502,7 +486,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -527,8 +511,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -555,7 +537,7 @@ async def delete( self, id: str, *, - account_id: str | None = None, + account_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, @@ -577,8 +559,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -599,7 +579,7 @@ async def read( self, id: str, *, - account_id: str | None = None, + account_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, @@ -621,8 +601,6 @@ async def read( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: @@ -643,7 +621,7 @@ async def sync( self, id: str, *, - account_id: str | None = None, + account_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, @@ -665,8 +643,6 @@ async def sync( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not id: diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index cdb6187e24d..a4046880de4 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -127,8 +127,8 @@ def create( *, domain: str, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -285,8 +285,8 @@ def create( def create( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_visible: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -371,8 +371,8 @@ def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -546,8 +546,8 @@ def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -720,8 +720,8 @@ def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_logo_url: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -802,8 +802,8 @@ def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -866,8 +866,8 @@ def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -930,8 +930,8 @@ def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -1000,8 +1000,8 @@ def create( def create( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, app_launcher_visible: bool | Omit = omit, domain: str | Omit = omit, logo_url: str | Omit = omit, @@ -1058,8 +1058,8 @@ def create( *, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, policies: Iterable[application_create_params.InfrastructureApplicationPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1100,8 +1100,8 @@ def create( domain: str, target_criteria: Iterable[application_create_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -1259,8 +1259,8 @@ def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -1371,8 +1371,8 @@ def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -1504,8 +1504,8 @@ def create( "proxy_endpoint", ] | Omit = omit, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -1588,10 +1588,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1676,8 +1672,8 @@ def update( *, domain: str, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -1837,8 +1833,8 @@ def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_visible: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -1926,8 +1922,8 @@ def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -2104,8 +2100,8 @@ def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -2281,8 +2277,8 @@ def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_logo_url: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -2366,8 +2362,8 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -2433,8 +2429,8 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -2500,8 +2496,8 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -2573,8 +2569,8 @@ def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, app_launcher_visible: bool | Omit = omit, domain: str | Omit = omit, logo_url: str | Omit = omit, @@ -2634,8 +2630,8 @@ def update( *, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, policies: Iterable[application_update_params.InfrastructureApplicationPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2679,8 +2675,8 @@ def update( domain: str, target_criteria: Iterable[application_update_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -2841,8 +2837,8 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -2956,8 +2952,8 @@ def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -3092,8 +3088,8 @@ def update( "proxy_endpoint", ] | Omit = omit, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -3178,10 +3174,6 @@ def update( ) -> Optional[ApplicationUpdateResponse]: if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3263,8 +3255,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, aud: str | Omit = omit, domain: str | Omit = omit, exact: bool | Omit = omit, @@ -3312,10 +3304,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3361,8 +3349,8 @@ def delete( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3390,10 +3378,6 @@ def delete( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3427,8 +3411,8 @@ def get( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3456,10 +3440,6 @@ def get( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3498,8 +3478,8 @@ def revoke_tokens( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3527,10 +3507,6 @@ def revoke_tokens( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3607,8 +3583,8 @@ async def create( *, domain: str, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -3765,8 +3741,8 @@ async def create( async def create( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_visible: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -3851,8 +3827,8 @@ async def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -4026,8 +4002,8 @@ async def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -4200,8 +4176,8 @@ async def create( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_logo_url: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -4282,8 +4258,8 @@ async def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -4346,8 +4322,8 @@ async def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -4410,8 +4386,8 @@ async def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -4480,8 +4456,8 @@ async def create( async def create( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, app_launcher_visible: bool | Omit = omit, domain: str | Omit = omit, logo_url: str | Omit = omit, @@ -4538,8 +4514,8 @@ async def create( *, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, policies: Iterable[application_create_params.InfrastructureApplicationPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -4580,8 +4556,8 @@ async def create( domain: str, target_criteria: Iterable[application_create_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -4739,8 +4715,8 @@ async def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -4851,8 +4827,8 @@ async def create( self, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -4984,8 +4960,8 @@ async def create( "proxy_endpoint", ] | Omit = omit, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -5068,10 +5044,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ApplicationCreateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -5156,8 +5128,8 @@ async def update( *, domain: str, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -5317,8 +5289,8 @@ async def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_visible: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -5406,8 +5378,8 @@ async def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -5584,8 +5556,8 @@ async def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -5761,8 +5733,8 @@ async def update( "mcp_portal", "proxy_endpoint", ], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, app_launcher_logo_url: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -5846,8 +5818,8 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -5913,8 +5885,8 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -5980,8 +5952,8 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, custom_deny_url: str | Omit = omit, @@ -6053,8 +6025,8 @@ async def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, app_launcher_visible: bool | Omit = omit, domain: str | Omit = omit, logo_url: str | Omit = omit, @@ -6114,8 +6086,8 @@ async def update( *, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, policies: Iterable[application_update_params.InfrastructureApplicationPolicy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -6159,8 +6131,8 @@ async def update( domain: str, target_criteria: Iterable[application_update_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -6321,8 +6293,8 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -6436,8 +6408,8 @@ async def update( app_id: AppID, *, type: ApplicationType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -6572,8 +6544,8 @@ async def update( "proxy_endpoint", ] | Omit = omit, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, @@ -6658,10 +6630,6 @@ async def update( ) -> Optional[ApplicationUpdateResponse]: if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -6743,8 +6711,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, aud: str | Omit = omit, domain: str | Omit = omit, exact: bool | Omit = omit, @@ -6792,10 +6760,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -6841,8 +6805,8 @@ async def delete( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6870,10 +6834,6 @@ async def delete( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -6907,8 +6867,8 @@ async def get( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -6936,10 +6896,6 @@ async def get( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -6978,8 +6934,8 @@ async def revoke_tokens( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -7007,10 +6963,6 @@ async def revoke_tokens( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/applications/cas.py b/src/cloudflare/resources/zero_trust/access/applications/cas.py index 6b94f74be28..87caf5d1074 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/cas.py +++ b/src/cloudflare/resources/zero_trust/access/applications/cas.py @@ -50,8 +50,8 @@ def create( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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,10 +79,6 @@ def create( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -115,8 +111,8 @@ def create( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -146,10 +142,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -189,8 +181,8 @@ def delete( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -218,10 +210,6 @@ def delete( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -255,8 +243,8 @@ def get( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -284,10 +272,6 @@ def get( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -342,8 +326,8 @@ async def create( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -371,10 +355,6 @@ async def create( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -407,8 +387,8 @@ async def create( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -438,10 +418,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -481,8 +457,8 @@ async def delete( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -510,10 +486,6 @@ async def delete( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -547,8 +519,8 @@ async def get( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -576,10 +548,6 @@ async def get( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index 80357828993..de6bd25d7a7 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -54,8 +54,8 @@ def create( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, connection_rules: policy_create_params.ConnectionRules | Omit = omit, @@ -120,10 +120,6 @@ def create( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -172,8 +168,8 @@ def update( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, connection_rules: policy_update_params.ConnectionRules | Omit = omit, @@ -241,10 +237,6 @@ def update( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -293,8 +285,8 @@ def list( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -330,10 +322,6 @@ def list( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -375,8 +363,8 @@ def delete( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -410,10 +398,6 @@ def delete( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -449,8 +433,8 @@ def get( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -484,10 +468,6 @@ def get( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -543,8 +523,8 @@ async def create( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, connection_rules: policy_create_params.ConnectionRules | Omit = omit, @@ -609,10 +589,6 @@ async def create( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -661,8 +637,8 @@ async def update( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, connection_rules: policy_update_params.ConnectionRules | Omit = omit, @@ -730,10 +706,6 @@ async def update( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -782,8 +754,8 @@ def list( self, app_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -819,10 +791,6 @@ def list( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -864,8 +832,8 @@ async def delete( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -899,10 +867,6 @@ async def delete( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -938,8 +902,8 @@ async def get( policy_id: str, *, app_id: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -973,10 +937,6 @@ async def get( raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") if not policy_id: raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py index 79319458393..a81e7948ed0 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> PolicyTestsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, policies: SequenceNotStr[policy_test_create_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -104,7 +102,7 @@ def get( self, policy_test_id: str, *, - account_id: str | None = None, + account_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, @@ -128,8 +126,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: @@ -178,7 +174,7 @@ def with_streaming_response(self) -> AsyncPolicyTestsResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, policies: SequenceNotStr[policy_test_create_params.Policy] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -201,8 +197,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -222,7 +216,7 @@ async def get( self, policy_test_id: str, *, - account_id: str | None = None, + account_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, @@ -246,8 +240,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py index 5d7941f44f3..955a2a7326e 100755 --- a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py @@ -48,7 +48,7 @@ def list( self, policy_test_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, status: Literal["success", "fail", "error"] | Omit = omit, @@ -79,8 +79,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: @@ -134,7 +132,7 @@ def list( self, policy_test_id: str, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, status: Literal["success", "fail", "error"] | Omit = omit, @@ -165,8 +163,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_test_id: diff --git a/src/cloudflare/resources/zero_trust/access/applications/settings.py b/src/cloudflare/resources/zero_trust/access/applications/settings.py index c260d1ea15e..7eace49c118 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/settings.py +++ b/src/cloudflare/resources/zero_trust/access/applications/settings.py @@ -51,8 +51,8 @@ def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_iframe: bool | Omit = omit, skip_interstitial: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,10 +86,6 @@ def update( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -130,8 +126,8 @@ def edit( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_iframe: bool | Omit = omit, skip_interstitial: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -165,10 +161,6 @@ def edit( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -230,8 +222,8 @@ async def update( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_iframe: bool | Omit = omit, skip_interstitial: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -265,10 +257,6 @@ async def update( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -309,8 +297,8 @@ async def edit( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_iframe: bool | Omit = omit, skip_interstitial: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -344,10 +332,6 @@ async def edit( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py b/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py index 47a90d689a4..91c0bc86c95 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py +++ b/src/cloudflare/resources/zero_trust/access/applications/user_policy_checks.py @@ -6,7 +6,7 @@ import httpx -from ....._types import Body, Query, Headers, NotGiven, not_given +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import path_template from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -49,8 +49,8 @@ def list( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,10 +78,6 @@ def list( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -136,8 +132,8 @@ async def list( self, app_id: AppID, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -165,10 +161,6 @@ async def list( """ if not app_id: raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/bookmarks.py b/src/cloudflare/resources/zero_trust/access/bookmarks.py index d192969d6f4..1b23eb2e890 100644 --- a/src/cloudflare/resources/zero_trust/access/bookmarks.py +++ b/src/cloudflare/resources/zero_trust/access/bookmarks.py @@ -52,7 +52,7 @@ def create( self, bookmark_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,8 +75,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -101,7 +99,7 @@ def update( self, bookmark_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -124,8 +122,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -149,7 +145,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -169,8 +165,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -187,7 +181,7 @@ def delete( self, bookmark_id: str, *, - account_id: str | None = None, + account_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, @@ -209,8 +203,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -234,7 +226,7 @@ def get( self, bookmark_id: str, *, - account_id: str | None = None, + account_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, @@ -256,8 +248,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -302,7 +292,7 @@ async def create( self, bookmark_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -325,8 +315,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -351,7 +339,7 @@ async def update( self, bookmark_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -374,8 +362,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -399,7 +385,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -419,8 +405,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -437,7 +421,7 @@ async def delete( self, bookmark_id: str, *, - account_id: str | None = None, + account_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, @@ -459,8 +443,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: @@ -484,7 +466,7 @@ async def get( self, bookmark_id: str, *, - account_id: str | None = None, + account_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, @@ -506,8 +488,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not bookmark_id: diff --git a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py index 4605c3f00e3..a8579e9d0b0 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/certificates.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/certificates.py @@ -64,8 +64,8 @@ def create( *, certificate: str, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, associated_hostnames: SequenceNotStr[AssociatedHostnames] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -96,10 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -141,8 +137,8 @@ def update( certificate_id: str, *, associated_hostnames: SequenceNotStr[AssociatedHostnames], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -175,10 +171,6 @@ def update( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -218,8 +210,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -249,10 +241,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -292,8 +280,8 @@ def delete( self, certificate_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -321,10 +309,6 @@ def delete( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -358,8 +342,8 @@ def get( self, certificate_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -387,10 +371,6 @@ def get( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -450,8 +430,8 @@ async def create( *, certificate: str, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, associated_hostnames: SequenceNotStr[AssociatedHostnames] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -482,10 +462,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -527,8 +503,8 @@ async def update( certificate_id: str, *, associated_hostnames: SequenceNotStr[AssociatedHostnames], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -561,10 +537,6 @@ async def update( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -604,8 +576,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -635,10 +607,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -678,8 +646,8 @@ async def delete( self, certificate_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -707,10 +675,6 @@ async def delete( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -744,8 +708,8 @@ async def get( self, certificate_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -773,10 +737,6 @@ async def get( """ if not certificate_id: raise ValueError(f"Expected a non-empty value for `certificate_id` but received {certificate_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/certificates/settings.py b/src/cloudflare/resources/zero_trust/access/certificates/settings.py index d67dc33ce7e..d51951f2312 100644 --- a/src/cloudflare/resources/zero_trust/access/certificates/settings.py +++ b/src/cloudflare/resources/zero_trust/access/certificates/settings.py @@ -6,7 +6,7 @@ import httpx -from ....._types import Body, Query, Headers, NotGiven, not_given +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import path_template, maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -49,8 +49,8 @@ def update( self, *, settings: Iterable[CertificateSettingsParam], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,10 +74,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -108,8 +104,8 @@ def update( def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -133,10 +129,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -187,8 +179,8 @@ def update( self, *, settings: Iterable[CertificateSettingsParam], - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -212,10 +204,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -246,8 +234,8 @@ def update( def get( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -271,10 +259,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/custom_pages.py b/src/cloudflare/resources/zero_trust/access/custom_pages.py index 139d8963bae..558f302cc3e 100644 --- a/src/cloudflare/resources/zero_trust/access/custom_pages.py +++ b/src/cloudflare/resources/zero_trust/access/custom_pages.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> CustomPagesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], @@ -82,8 +82,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -110,7 +108,7 @@ def update( self, custom_page_id: str, *, - account_id: str | None = None, + account_id: str, custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], @@ -143,8 +141,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: @@ -176,7 +172,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -204,8 +200,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -231,7 +225,7 @@ def delete( self, custom_page_id: str, *, - account_id: str | None = None, + account_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, @@ -255,8 +249,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: @@ -281,7 +273,7 @@ def get( self, custom_page_id: str, *, - account_id: str | None = None, + account_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, @@ -305,8 +297,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: @@ -351,7 +341,7 @@ def with_streaming_response(self) -> AsyncCustomPagesResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], @@ -382,8 +372,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -410,7 +398,7 @@ async def update( self, custom_page_id: str, *, - account_id: str | None = None, + account_id: str, custom_html: str, name: str, type: Literal["identity_denied", "forbidden"], @@ -443,8 +431,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: @@ -476,7 +462,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -504,8 +490,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -531,7 +515,7 @@ async def delete( self, custom_page_id: str, *, - account_id: str | None = None, + account_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, @@ -555,8 +539,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: @@ -581,7 +563,7 @@ async def get( self, custom_page_id: str, *, - account_id: str | None = None, + account_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, @@ -605,8 +587,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not custom_page_id: diff --git a/src/cloudflare/resources/zero_trust/access/gateway_ca.py b/src/cloudflare/resources/zero_trust/access/gateway_ca.py index 559fff3c106..7eba96b6629 100644 --- a/src/cloudflare/resources/zero_trust/access/gateway_ca.py +++ b/src/cloudflare/resources/zero_trust/access/gateway_ca.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> GatewayCAResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -90,7 +88,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -112,8 +110,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -129,7 +125,7 @@ def delete( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -153,8 +149,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -199,7 +193,7 @@ def with_streaming_response(self) -> AsyncGatewayCAResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_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, @@ -221,8 +215,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -240,7 +232,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -262,8 +254,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -279,7 +269,7 @@ async def delete( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -303,8 +293,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: diff --git a/src/cloudflare/resources/zero_trust/access/groups.py b/src/cloudflare/resources/zero_trust/access/groups.py index 48aac0f3c4b..f9522ca74e8 100644 --- a/src/cloudflare/resources/zero_trust/access/groups.py +++ b/src/cloudflare/resources/zero_trust/access/groups.py @@ -55,8 +55,8 @@ def create( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, is_default: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -96,10 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -144,8 +140,8 @@ def update( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, is_default: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -189,10 +185,6 @@ def update( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -235,8 +227,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -272,10 +264,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -317,8 +305,8 @@ def delete( self, group_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -346,10 +334,6 @@ def delete( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -383,8 +367,8 @@ def get( self, group_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -412,10 +396,6 @@ def get( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -471,8 +451,8 @@ async def create( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, is_default: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -512,10 +492,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -560,8 +536,8 @@ async def update( *, include: Iterable[AccessRuleParam], name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, is_default: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -605,10 +581,6 @@ async def update( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -651,8 +623,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -688,10 +660,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -733,8 +701,8 @@ async def delete( self, group_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -762,10 +730,6 @@ async def delete( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -799,8 +763,8 @@ async def get( self, group_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -828,10 +792,6 @@ async def get( """ if not group_id: raise ValueError(f"Expected a non-empty value for `group_id` but received {group_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py index 71a82df1fc6..a6b792c1b5b 100644 --- a/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py +++ b/src/cloudflare/resources/zero_trust/access/infrastructure/targets.py @@ -61,7 +61,7 @@ def with_streaming_response(self) -> TargetsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, hostname: str, ip: target_create_params.IP, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -91,8 +91,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -118,7 +116,7 @@ def update( self, target_id: str, *, - account_id: str | None = None, + account_id: str, hostname: str, ip: target_update_params.IP, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -150,8 +148,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: @@ -180,7 +176,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, created_after: Union[str, datetime, None] | Omit = omit, created_before: Union[str, datetime, None] | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, @@ -271,8 +267,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -316,7 +310,7 @@ def delete( self, target_id: str, *, - account_id: str | None = None, + account_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, @@ -340,8 +334,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: @@ -361,7 +353,7 @@ def delete( def bulk_delete( self, *, - account_id: str | None = None, + account_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, @@ -383,8 +375,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -399,7 +389,7 @@ def bulk_delete( def bulk_delete_v2( self, *, - account_id: str | None = None, + account_id: str, target_ids: SequenceNotStr[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. @@ -424,8 +414,6 @@ def bulk_delete_v2( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -441,7 +429,7 @@ def bulk_delete_v2( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[target_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -464,8 +452,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -483,7 +469,7 @@ def get( self, target_id: str, *, - account_id: str | None = None, + account_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, @@ -507,8 +493,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: @@ -551,7 +535,7 @@ def with_streaming_response(self) -> AsyncTargetsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, hostname: str, ip: target_create_params.IP, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -581,8 +565,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -608,7 +590,7 @@ async def update( self, target_id: str, *, - account_id: str | None = None, + account_id: str, hostname: str, ip: target_update_params.IP, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -640,8 +622,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: @@ -670,7 +650,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, created_after: Union[str, datetime, None] | Omit = omit, created_before: Union[str, datetime, None] | Omit = omit, direction: Literal["asc", "desc"] | Omit = omit, @@ -761,8 +741,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -806,7 +784,7 @@ async def delete( self, target_id: str, *, - account_id: str | None = None, + account_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, @@ -830,8 +808,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: @@ -851,7 +827,7 @@ async def delete( async def bulk_delete( self, *, - account_id: str | None = None, + account_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, @@ -873,8 +849,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -889,7 +863,7 @@ async def bulk_delete( async def bulk_delete_v2( self, *, - account_id: str | None = None, + account_id: str, target_ids: SequenceNotStr[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. @@ -914,8 +888,6 @@ async def bulk_delete_v2( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} @@ -933,7 +905,7 @@ async def bulk_delete_v2( def bulk_update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[target_bulk_update_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -956,8 +928,6 @@ def bulk_update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -975,7 +945,7 @@ async def get( self, target_id: str, *, - account_id: str | None = None, + account_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, @@ -999,8 +969,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not target_id: diff --git a/src/cloudflare/resources/zero_trust/access/keys.py b/src/cloudflare/resources/zero_trust/access/keys.py index ea9cea5410a..7814e5d1b13 100644 --- a/src/cloudflare/resources/zero_trust/access/keys.py +++ b/src/cloudflare/resources/zero_trust/access/keys.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> KeysResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, key_rotation_interval_days: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -96,7 +94,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -118,8 +116,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -137,7 +133,7 @@ def get( def rotate( self, *, - account_id: str | None = None, + account_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, @@ -159,8 +155,6 @@ def rotate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -199,7 +193,7 @@ def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, key_rotation_interval_days: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -224,8 +218,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -246,7 +238,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -268,8 +260,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -287,7 +277,7 @@ async def get( async def rotate( self, *, - account_id: str | None = None, + account_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, @@ -309,8 +299,6 @@ async def rotate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/zero_trust/access/logs/access_requests.py b/src/cloudflare/resources/zero_trust/access/logs/access_requests.py index f7de2d4a9f3..06b0f797e51 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/access_requests.py +++ b/src/cloudflare/resources/zero_trust/access/logs/access_requests.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> AccessRequestsResourceWithStreamingResponse def list( self, *, - account_id: str | None = None, + account_id: str, allowed_op: Literal["eq", "neq"] | Omit = omit, app_type_op: Literal["eq", "neq"] | Omit = omit, app_uid_op: Literal["eq", "neq"] | Omit = omit, @@ -132,8 +132,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -196,7 +194,7 @@ def with_streaming_response(self) -> AsyncAccessRequestsResourceWithStreamingRes async def list( self, *, - account_id: str | None = None, + account_id: str, allowed_op: Literal["eq", "neq"] | Omit = omit, app_type_op: Literal["eq", "neq"] | Omit = omit, app_uid_op: Literal["eq", "neq"] | Omit = omit, @@ -279,8 +277,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py b/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py index a035f1a297d..ce98c696427 100644 --- a/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py +++ b/src/cloudflare/resources/zero_trust/access/logs/scim/updates.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> UpdatesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, idp_id: SequenceNotStr[str], cf_resource_id: str | Omit = omit, direction: Literal["desc", "asc"] | Omit = omit, @@ -115,8 +115,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -174,7 +172,7 @@ def with_streaming_response(self) -> AsyncUpdatesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, idp_id: SequenceNotStr[str], cf_resource_id: str | Omit = omit, direction: Literal["desc", "asc"] | Omit = omit, @@ -240,8 +238,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index 258618f1081..164c2eea10d 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -55,7 +55,7 @@ def with_streaming_response(self) -> PoliciesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, decision: Decision, include: Iterable[AccessRuleParam], name: str, @@ -126,8 +126,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -164,7 +162,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, decision: Decision, include: Iterable[AccessRuleParam], name: str, @@ -237,8 +235,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -278,7 +274,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -306,8 +302,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -333,7 +327,7 @@ def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -357,8 +351,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -381,7 +373,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -405,8 +397,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -449,7 +439,7 @@ def with_streaming_response(self) -> AsyncPoliciesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, decision: Decision, include: Iterable[AccessRuleParam], name: str, @@ -520,8 +510,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -558,7 +546,7 @@ async def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, decision: Decision, include: Iterable[AccessRuleParam], name: str, @@ -631,8 +619,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -672,7 +658,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -700,8 +686,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -727,7 +711,7 @@ async def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -751,8 +735,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -775,7 +757,7 @@ async def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -799,8 +781,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/zero_trust/access/service_tokens.py b/src/cloudflare/resources/zero_trust/access/service_tokens.py index 9fce2e1d1a5..287f4f0f983 100644 --- a/src/cloudflare/resources/zero_trust/access/service_tokens.py +++ b/src/cloudflare/resources/zero_trust/access/service_tokens.py @@ -57,8 +57,8 @@ def create( self, *, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, client_secret_version: float | Omit = omit, duration: str | Omit = omit, previous_client_secret_expires_at: Union[str, datetime] | Omit = omit, @@ -104,10 +104,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -149,8 +145,8 @@ def update( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, client_secret_version: float | Omit = omit, duration: str | Omit = omit, name: str | Omit = omit, @@ -198,10 +194,6 @@ def update( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -243,8 +235,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -280,10 +272,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -325,8 +313,8 @@ def delete( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -354,10 +342,6 @@ def delete( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -391,8 +375,8 @@ def get( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -420,10 +404,6 @@ def get( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -457,7 +437,7 @@ def refresh( self, service_token_id: str, *, - account_id: str | None = None, + account_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, @@ -481,8 +461,6 @@ def refresh( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_token_id: @@ -507,7 +485,7 @@ def rotate( self, service_token_id: str, *, - account_id: str | None = None, + account_id: str, previous_client_secret_expires_at: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -535,8 +513,6 @@ def rotate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_token_id: @@ -586,8 +562,8 @@ async def create( self, *, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, client_secret_version: float | Omit = omit, duration: str | Omit = omit, previous_client_secret_expires_at: Union[str, datetime] | Omit = omit, @@ -633,10 +609,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -678,8 +650,8 @@ async def update( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, client_secret_version: float | Omit = omit, duration: str | Omit = omit, name: str | Omit = omit, @@ -727,10 +699,6 @@ async def update( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -772,8 +740,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, @@ -809,10 +777,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -854,8 +818,8 @@ async def delete( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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,10 +847,6 @@ async def delete( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -920,8 +880,8 @@ async def get( self, service_token_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -949,10 +909,6 @@ async def get( """ if not service_token_id: raise ValueError(f"Expected a non-empty value for `service_token_id` but received {service_token_id!r}") - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -986,7 +942,7 @@ async def refresh( self, service_token_id: str, *, - account_id: str | None = None, + account_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, @@ -1010,8 +966,6 @@ async def refresh( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_token_id: @@ -1036,7 +990,7 @@ async def rotate( self, service_token_id: str, *, - account_id: str | None = None, + account_id: str, previous_client_secret_expires_at: Union[str, datetime] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1064,8 +1018,6 @@ async def rotate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not service_token_id: diff --git a/src/cloudflare/resources/zero_trust/access/tags.py b/src/cloudflare/resources/zero_trust/access/tags.py index e7d0e9c83da..3c91f378971 100644 --- a/src/cloudflare/resources/zero_trust/access/tags.py +++ b/src/cloudflare/resources/zero_trust/access/tags.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> TagsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -74,8 +74,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -95,7 +93,7 @@ def update( self, tag_name: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -122,8 +120,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: @@ -144,7 +140,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -172,8 +168,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -199,7 +193,7 @@ def delete( self, tag_name: str, *, - account_id: str | None = None, + account_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, @@ -223,8 +217,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: @@ -245,7 +237,7 @@ def get( self, tag_name: str, *, - account_id: str | None = None, + account_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, @@ -269,8 +261,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: @@ -311,7 +301,7 @@ def with_streaming_response(self) -> AsyncTagsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -336,8 +326,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -357,7 +345,7 @@ async def update( self, tag_name: str, *, - account_id: str | None = None, + account_id: str, name: 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. @@ -384,8 +372,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: @@ -406,7 +392,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -434,8 +420,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -461,7 +445,7 @@ async def delete( self, tag_name: str, *, - account_id: str | None = None, + account_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, @@ -485,8 +469,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: @@ -507,7 +489,7 @@ async def get( self, tag_name: str, *, - account_id: str | None = None, + account_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, @@ -531,8 +513,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tag_name: diff --git a/src/cloudflare/resources/zero_trust/access/users/active_sessions.py b/src/cloudflare/resources/zero_trust/access/users/active_sessions.py index a01b95d37fb..cde67a150d1 100644 --- a/src/cloudflare/resources/zero_trust/access/users/active_sessions.py +++ b/src/cloudflare/resources/zero_trust/access/users/active_sessions.py @@ -49,7 +49,7 @@ def list( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -73,8 +73,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -94,7 +92,7 @@ def get( self, nonce: str, *, - account_id: str | None = None, + account_id: str, user_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. @@ -119,8 +117,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -169,7 +165,7 @@ def list( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -193,8 +189,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -214,7 +208,7 @@ async def get( self, nonce: str, *, - account_id: str | None = None, + account_id: str, user_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. @@ -239,8 +233,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: diff --git a/src/cloudflare/resources/zero_trust/access/users/failed_logins.py b/src/cloudflare/resources/zero_trust/access/users/failed_logins.py index c0bf624dceb..22f4d9b1728 100644 --- a/src/cloudflare/resources/zero_trust/access/users/failed_logins.py +++ b/src/cloudflare/resources/zero_trust/access/users/failed_logins.py @@ -45,7 +45,7 @@ def list( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -111,7 +109,7 @@ def list( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -135,8 +133,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: diff --git a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py index bfda21b721b..e0203e75850 100644 --- a/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py +++ b/src/cloudflare/resources/zero_trust/access/users/last_seen_identity.py @@ -47,7 +47,7 @@ def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -118,7 +116,7 @@ async def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -142,8 +140,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 3a0fd27d4ef..2b0922764c6 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -87,7 +87,7 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, email: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -115,8 +115,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -142,7 +140,7 @@ def update( self, user_id: str, *, - account_id: str | None = None, + account_id: str, email: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -174,8 +172,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -202,7 +198,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, email: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, @@ -239,8 +235,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -269,7 +263,7 @@ def delete( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -295,8 +289,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -317,7 +309,7 @@ def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -341,8 +333,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -395,7 +385,7 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, email: str, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -423,8 +413,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -450,7 +438,7 @@ async def update( self, user_id: str, *, - account_id: str | None = None, + account_id: str, email: str, name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -482,8 +470,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -510,7 +496,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, email: str | Omit = omit, name: str | Omit = omit, page: int | Omit = omit, @@ -547,8 +533,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -577,7 +561,7 @@ async def delete( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -603,8 +587,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -625,7 +607,7 @@ async def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -649,8 +631,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: diff --git a/src/cloudflare/resources/zero_trust/connectivity_settings.py b/src/cloudflare/resources/zero_trust/connectivity_settings.py index 34a5b7840b1..bafa43f6d99 100644 --- a/src/cloudflare/resources/zero_trust/connectivity_settings.py +++ b/src/cloudflare/resources/zero_trust/connectivity_settings.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> ConnectivitySettingsResourceWithStreamingRe def edit( self, *, - account_id: str | None = None, + account_id: str, icmp_proxy_enabled: bool | Omit = omit, offramp_warp_enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -76,8 +76,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -102,7 +100,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -124,8 +122,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -164,7 +160,7 @@ def with_streaming_response(self) -> AsyncConnectivitySettingsResourceWithStream async def edit( self, *, - account_id: str | None = None, + account_id: str, icmp_proxy_enabled: bool | Omit = omit, offramp_warp_enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -192,8 +188,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -218,7 +212,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -240,8 +234,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index 16f8ddcf0a1..d94495d96a1 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -199,7 +199,7 @@ def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -227,8 +227,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -245,7 +243,7 @@ def get( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -276,8 +274,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -371,7 +367,7 @@ def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -399,8 +395,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -417,7 +411,7 @@ async def get( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -448,8 +442,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: diff --git a/src/cloudflare/resources/zero_trust/devices/devices_.py b/src/cloudflare/resources/zero_trust/devices/devices_.py index a92df9b2c59..c6228580780 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices_.py +++ b/src/cloudflare/resources/zero_trust/devices/devices_.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[str] | Omit = omit, active_registrations: Literal["include", "only", "exclude"] | Omit = omit, cursor: str | Omit = omit, @@ -110,8 +110,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -146,7 +144,7 @@ def delete( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -166,8 +164,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -192,7 +188,7 @@ def get( self, device_id: str, *, - account_id: str | None = None, + account_id: str, include: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -216,8 +212,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -243,7 +237,7 @@ def revoke( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -263,8 +257,6 @@ def revoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -309,7 +301,7 @@ def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[str] | Omit = omit, active_registrations: Literal["include", "only", "exclude"] | Omit = omit, cursor: str | Omit = omit, @@ -369,8 +361,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -405,7 +395,7 @@ async def delete( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -425,8 +415,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -451,7 +439,7 @@ async def get( self, device_id: str, *, - account_id: str | None = None, + account_id: str, include: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -475,8 +463,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -502,7 +488,7 @@ async def revoke( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -522,8 +508,6 @@ async def revoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: diff --git a/src/cloudflare/resources/zero_trust/devices/dex_tests.py b/src/cloudflare/resources/zero_trust/devices/dex_tests.py index a1709c3f528..3514a023e2c 100644 --- a/src/cloudflare/resources/zero_trust/devices/dex_tests.py +++ b/src/cloudflare/resources/zero_trust/devices/dex_tests.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> DEXTestsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, data: dex_test_create_params.Data, enabled: bool, interval: str, @@ -93,8 +93,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -125,7 +123,7 @@ def update( self, dex_test_id: str, *, - account_id: str | None = None, + account_id: str, data: dex_test_update_params.Data, enabled: bool, interval: str, @@ -167,8 +165,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: @@ -204,7 +200,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["http", "traceroute"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -236,8 +232,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -265,7 +259,7 @@ def delete( self, dex_test_id: str, *, - account_id: str | None = None, + account_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, @@ -289,8 +283,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: @@ -315,7 +307,7 @@ def get( self, dex_test_id: str, *, - account_id: str | None = None, + account_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, @@ -337,8 +329,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: @@ -383,7 +373,7 @@ def with_streaming_response(self) -> AsyncDEXTestsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, data: dex_test_create_params.Data, enabled: bool, interval: str, @@ -423,8 +413,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -455,7 +443,7 @@ async def update( self, dex_test_id: str, *, - account_id: str | None = None, + account_id: str, data: dex_test_update_params.Data, enabled: bool, interval: str, @@ -497,8 +485,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: @@ -534,7 +520,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["http", "traceroute"] | Omit = omit, page: float | Omit = omit, per_page: float | Omit = omit, @@ -566,8 +552,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -595,7 +579,7 @@ async def delete( self, dex_test_id: str, *, - account_id: str | None = None, + account_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, @@ -619,8 +603,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: @@ -645,7 +627,7 @@ async def get( self, dex_test_id: str, *, - account_id: str | None = None, + account_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, @@ -667,8 +649,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dex_test_id: diff --git a/src/cloudflare/resources/zero_trust/devices/fleet_status.py b/src/cloudflare/resources/zero_trust/devices/fleet_status.py index e9cb4a8b7f1..dccbc892b71 100644 --- a/src/cloudflare/resources/zero_trust/devices/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/devices/fleet_status.py @@ -45,7 +45,7 @@ def get( self, device_id: str, *, - account_id: str | None = None, + account_id: str, since_minutes: float, colo: str | Omit = omit, time_now: str | Omit = omit, @@ -77,8 +77,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -131,7 +129,7 @@ async def get( self, device_id: str, *, - account_id: str | None = None, + account_id: str, since_minutes: float, colo: str | Omit = omit, time_now: str | Omit = omit, @@ -163,8 +161,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: diff --git a/src/cloudflare/resources/zero_trust/devices/ip_profiles.py b/src/cloudflare/resources/zero_trust/devices/ip_profiles.py index d48e85f8da6..f44ec908fba 100644 --- a/src/cloudflare/resources/zero_trust/devices/ip_profiles.py +++ b/src/cloudflare/resources/zero_trust/devices/ip_profiles.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> IPProfilesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, precedence: int, @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -125,7 +123,7 @@ def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, enabled: bool | Omit = omit, match: str | Omit = omit, @@ -170,8 +168,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -204,7 +200,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -227,8 +223,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -248,7 +242,7 @@ def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -268,8 +262,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -292,7 +284,7 @@ def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -312,8 +304,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -356,7 +346,7 @@ def with_streaming_response(self) -> AsyncIPProfilesResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, precedence: int, @@ -401,8 +391,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -432,7 +420,7 @@ async def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, enabled: bool | Omit = omit, match: str | Omit = omit, @@ -477,8 +465,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -511,7 +497,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -534,8 +520,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -555,7 +539,7 @@ async def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -575,8 +559,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -599,7 +581,7 @@ async def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -619,8 +601,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: diff --git a/src/cloudflare/resources/zero_trust/devices/networks.py b/src/cloudflare/resources/zero_trust/devices/networks.py index 045e278d08f..a7996296d3d 100644 --- a/src/cloudflare/resources/zero_trust/devices/networks.py +++ b/src/cloudflare/resources/zero_trust/devices/networks.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> NetworksResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, config: network_create_params.Config, name: str, type: Literal["tls"], @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def update( self, network_id: str, *, - account_id: str | None = None, + account_id: str, config: network_update_params.Config | Omit = omit, name: str | Omit = omit, type: Literal["tls"] | Omit = omit, @@ -139,8 +137,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: @@ -170,7 +166,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -190,8 +186,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -207,7 +201,7 @@ def delete( self, network_id: str, *, - account_id: str | None = None, + account_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, @@ -230,8 +224,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: @@ -252,7 +244,7 @@ def get( self, network_id: str, *, - account_id: str | None = None, + account_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, @@ -274,8 +266,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: @@ -318,7 +308,7 @@ def with_streaming_response(self) -> AsyncNetworksResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, config: network_create_params.Config, name: str, type: Literal["tls"], @@ -348,8 +338,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -376,7 +364,7 @@ async def update( self, network_id: str, *, - account_id: str | None = None, + account_id: str, config: network_update_params.Config | Omit = omit, name: str | Omit = omit, type: Literal["tls"] | Omit = omit, @@ -408,8 +396,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: @@ -439,7 +425,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -459,8 +445,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -476,7 +460,7 @@ def delete( self, network_id: str, *, - account_id: str | None = None, + account_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, @@ -499,8 +483,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: @@ -521,7 +503,7 @@ async def get( self, network_id: str, *, - account_id: str | None = None, + account_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, @@ -543,8 +525,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not network_id: diff --git a/src/cloudflare/resources/zero_trust/devices/override_codes.py b/src/cloudflare/resources/zero_trust/devices/override_codes.py index 0d3c2cf3dc3..4c9324b0fd3 100644 --- a/src/cloudflare/resources/zero_trust/devices/override_codes.py +++ b/src/cloudflare/resources/zero_trust/devices/override_codes.py @@ -50,7 +50,7 @@ def list( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -80,8 +80,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -101,7 +99,7 @@ def get( self, registration_id: str, *, - account_id: str | None = None, + account_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, @@ -123,8 +121,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: @@ -171,7 +167,7 @@ def list( self, device_id: str, *, - account_id: str | None = None, + account_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, @@ -201,8 +197,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not device_id: @@ -222,7 +216,7 @@ async def get( self, registration_id: str, *, - account_id: str | None = None, + account_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, @@ -244,8 +238,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py index b55890e03cd..ae7b27236a8 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py @@ -86,7 +86,7 @@ def with_streaming_response(self) -> CustomResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, precedence: float, @@ -186,8 +186,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -232,7 +230,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -252,8 +250,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -269,7 +265,7 @@ def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -290,8 +286,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -312,7 +306,7 @@ def edit( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, allow_mode_switch: bool | Omit = omit, allow_updates: bool | Omit = omit, allowed_to_leave: bool | Omit = omit, @@ -411,8 +405,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -462,7 +454,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -482,8 +474,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -538,7 +528,7 @@ def with_streaming_response(self) -> AsyncCustomResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, precedence: float, @@ -638,8 +628,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -684,7 +672,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -704,8 +692,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -721,7 +707,7 @@ def delete( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -742,8 +728,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -764,7 +748,7 @@ async def edit( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, allow_mode_switch: bool | Omit = omit, allow_updates: bool | Omit = omit, allowed_to_leave: bool | Omit = omit, @@ -863,8 +847,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -914,7 +896,7 @@ async def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -934,8 +916,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py index db0818778eb..c35123b7381 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/excludes.py @@ -48,7 +48,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelExcludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -93,7 +91,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -114,8 +112,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -156,7 +152,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelExcludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -178,8 +174,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -201,7 +195,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -222,8 +216,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py index 66f19dd32f0..e8679d2efd3 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/fallback_domains.py @@ -48,7 +48,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, domains: Iterable[FallbackDomainParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -72,8 +72,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -97,7 +95,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -119,8 +117,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -163,7 +159,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, domains: Iterable[FallbackDomainParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -187,8 +183,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -212,7 +206,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -234,8 +228,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py index a0da203718b..66c12f55124 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/includes.py @@ -48,7 +48,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelIncludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -93,7 +91,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -114,8 +112,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -156,7 +152,7 @@ def update( self, policy_id: str, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelIncludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -178,8 +174,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: @@ -201,7 +195,7 @@ def get( self, policy_id: str, *, - account_id: str | None = None, + account_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, @@ -222,8 +216,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not policy_id: diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py index 38c6429be44..075e76637b0 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/certificates.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> CertificatesResourceWithStreamingResponse: def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,8 +73,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -93,7 +91,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -113,8 +111,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -153,7 +149,7 @@ def with_streaming_response(self) -> AsyncCertificatesResourceWithStreamingRespo async def edit( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -179,8 +175,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -199,7 +193,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -219,8 +213,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py index cdae21e89c0..42273b7fee8 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py @@ -98,7 +98,7 @@ def with_streaming_response(self) -> DefaultResourceWithStreamingResponse: def edit( self, *, - account_id: str | None = None, + account_id: str, allow_mode_switch: bool | Omit = omit, allow_updates: bool | Omit = omit, allowed_to_leave: bool | Omit = omit, @@ -178,8 +178,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -219,7 +217,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -239,8 +237,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -295,7 +291,7 @@ def with_streaming_response(self) -> AsyncDefaultResourceWithStreamingResponse: async def edit( self, *, - account_id: str | None = None, + account_id: str, allow_mode_switch: bool | Omit = omit, allow_updates: bool | Omit = omit, allowed_to_leave: bool | Omit = omit, @@ -375,8 +371,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -416,7 +410,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -436,8 +430,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py index 2bbec11e3da..ac2ccd9b061 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/excludes.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ExcludesResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelExcludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,8 +68,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -86,7 +84,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -106,8 +104,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -143,7 +139,7 @@ def with_streaming_response(self) -> AsyncExcludesResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelExcludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -164,8 +160,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -182,7 +176,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -202,8 +196,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py index 3d4b5dc2ef2..4122968a154 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/fallback_domains.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> FallbackDomainsResourceWithStreamingRespons def update( self, *, - account_id: str | None = None, + account_id: str, domains: Iterable[FallbackDomainParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -88,7 +86,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -110,8 +108,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -147,7 +143,7 @@ def with_streaming_response(self) -> AsyncFallbackDomainsResourceWithStreamingRe def update( self, *, - account_id: str | None = None, + account_id: str, domains: Iterable[FallbackDomainParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -170,8 +166,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +182,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -210,8 +204,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py index 072652a7855..3443e8498ad 100644 --- a/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py +++ b/src/cloudflare/resources/zero_trust/devices/policies/default/includes.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> IncludesResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelIncludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,8 +68,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -86,7 +84,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -106,8 +104,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -143,7 +139,7 @@ def with_streaming_response(self) -> AsyncIncludesResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[SplitTunnelIncludeParam], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -164,8 +160,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -182,7 +176,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -202,8 +196,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py index 9615f230fa8..1a43dcdb4d7 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/integrations.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/integrations.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> IntegrationsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, config: integration_create_params.Config, interval: str, name: str, @@ -92,8 +92,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -120,7 +118,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -140,8 +138,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -157,7 +153,7 @@ def delete( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -179,8 +175,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -210,7 +204,7 @@ def edit( self, integration_id: str, *, - account_id: str | None = None, + account_id: str, config: integration_edit_params.Config | Omit = omit, interval: str | Omit = omit, name: str | Omit = omit, @@ -255,8 +249,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -290,7 +282,7 @@ def get( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -312,8 +304,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -358,7 +348,7 @@ def with_streaming_response(self) -> AsyncIntegrationsResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, config: integration_create_params.Config, interval: str, name: str, @@ -400,8 +390,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -428,7 +416,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -448,8 +436,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -465,7 +451,7 @@ async def delete( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -487,8 +473,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -518,7 +502,7 @@ async def edit( self, integration_id: str, *, - account_id: str | None = None, + account_id: str, config: integration_edit_params.Config | Omit = omit, interval: str | Omit = omit, name: str | Omit = omit, @@ -563,8 +547,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -598,7 +580,7 @@ async def get( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -620,8 +602,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: diff --git a/src/cloudflare/resources/zero_trust/devices/posture/posture.py b/src/cloudflare/resources/zero_trust/devices/posture/posture.py index ab2f7d6cb81..bc23c94e971 100644 --- a/src/cloudflare/resources/zero_trust/devices/posture/posture.py +++ b/src/cloudflare/resources/zero_trust/devices/posture/posture.py @@ -64,7 +64,7 @@ def with_streaming_response(self) -> PostureResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, type: Literal[ "file", @@ -131,8 +131,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -163,7 +161,7 @@ def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, name: str, type: Literal[ "file", @@ -232,8 +230,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -265,7 +261,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -285,8 +281,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -302,7 +296,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -324,8 +318,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -346,7 +338,7 @@ def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -368,8 +360,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -414,7 +404,7 @@ def with_streaming_response(self) -> AsyncPostureResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, type: Literal[ "file", @@ -481,8 +471,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -513,7 +501,7 @@ async def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, name: str, type: Literal[ "file", @@ -582,8 +570,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -615,7 +601,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -635,8 +621,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -652,7 +636,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -674,8 +658,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -696,7 +678,7 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -718,8 +700,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/zero_trust/devices/registrations.py b/src/cloudflare/resources/zero_trust/devices/registrations.py index 2e6bfed5c19..d98268462cf 100644 --- a/src/cloudflare/resources/zero_trust/devices/registrations.py +++ b/src/cloudflare/resources/zero_trust/devices/registrations.py @@ -56,7 +56,7 @@ def with_streaming_response(self) -> RegistrationsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[str] | Omit = omit, cursor: str | Omit = omit, device: registration_list_params.Device | Omit = omit, @@ -113,8 +113,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -150,7 +148,7 @@ def delete( self, registration_id: str, *, - account_id: str | None = None, + account_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, @@ -170,8 +168,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: @@ -195,7 +191,7 @@ def delete( def bulk_delete( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -218,8 +214,6 @@ def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -239,7 +233,7 @@ def get( self, registration_id: str, *, - account_id: str | None = None, + account_id: str, include: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -263,8 +257,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: @@ -289,7 +281,7 @@ def get( def revoke( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -312,8 +304,6 @@ def revoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -332,7 +322,7 @@ def revoke( def unrevoke( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -355,8 +345,6 @@ def unrevoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -396,7 +384,7 @@ def with_streaming_response(self) -> AsyncRegistrationsResourceWithStreamingResp def list( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[str] | Omit = omit, cursor: str | Omit = omit, device: registration_list_params.Device | Omit = omit, @@ -453,8 +441,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -490,7 +476,7 @@ async def delete( self, registration_id: str, *, - account_id: str | None = None, + account_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, @@ -510,8 +496,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: @@ -535,7 +519,7 @@ async def delete( async def bulk_delete( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -558,8 +542,6 @@ async def bulk_delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -581,7 +563,7 @@ async def get( self, registration_id: str, *, - account_id: str | None = None, + account_id: str, include: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -605,8 +587,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not registration_id: @@ -631,7 +611,7 @@ async def get( async def revoke( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -654,8 +634,6 @@ async def revoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -674,7 +652,7 @@ async def revoke( async def unrevoke( self, *, - account_id: str | None = None, + account_id: str, id: SequenceNotStr[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. @@ -697,8 +675,6 @@ async def unrevoke( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/zero_trust/devices/resilience/global_warp_override.py b/src/cloudflare/resources/zero_trust/devices/resilience/global_warp_override.py index a686a99a1d4..5e277a56a93 100644 --- a/src/cloudflare/resources/zero_trust/devices/resilience/global_warp_override.py +++ b/src/cloudflare/resources/zero_trust/devices/resilience/global_warp_override.py @@ -50,7 +50,7 @@ def with_streaming_response(self) -> GlobalWARPOverrideResourceWithStreamingResp def create( self, *, - account_id: str | None = None, + account_id: str, disconnect: bool, justification: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -105,7 +103,7 @@ def create( def get( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -165,7 +161,7 @@ def with_streaming_response(self) -> AsyncGlobalWARPOverrideResourceWithStreamin async def create( self, *, - account_id: str | None = None, + account_id: str, disconnect: bool, justification: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -192,8 +188,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -220,7 +214,7 @@ async def create( async def get( self, *, - account_id: str | None = None, + account_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, @@ -240,8 +234,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/devices/revoke.py b/src/cloudflare/resources/zero_trust/devices/revoke.py index 7b29dee00b3..ca5faded4d4 100644 --- a/src/cloudflare/resources/zero_trust/devices/revoke.py +++ b/src/cloudflare/resources/zero_trust/devices/revoke.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> RevokeResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -124,7 +122,7 @@ def with_streaming_response(self) -> AsyncRevokeResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -153,8 +151,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( diff --git a/src/cloudflare/resources/zero_trust/devices/settings.py b/src/cloudflare/resources/zero_trust/devices/settings.py index 9484eea885d..f081985e923 100644 --- a/src/cloudflare/resources/zero_trust/devices/settings.py +++ b/src/cloudflare/resources/zero_trust/devices/settings.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, disable_for_time: float | Omit = omit, external_emergency_signal_enabled: bool | Omit = omit, external_emergency_signal_fingerprint: str | Omit = omit, @@ -101,8 +101,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -134,7 +132,7 @@ def update( def delete( self, *, - account_id: str | None = None, + account_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, @@ -154,8 +152,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -173,7 +169,7 @@ def delete( def edit( self, *, - account_id: str | None = None, + account_id: str, disable_for_time: float | Omit = omit, external_emergency_signal_enabled: bool | Omit = omit, external_emergency_signal_fingerprint: str | Omit = omit, @@ -227,8 +223,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -260,7 +254,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -280,8 +274,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -320,7 +312,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, disable_for_time: float | Omit = omit, external_emergency_signal_enabled: bool | Omit = omit, external_emergency_signal_fingerprint: str | Omit = omit, @@ -374,8 +366,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -407,7 +397,7 @@ async def update( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -427,8 +417,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -446,7 +434,7 @@ async def delete( async def edit( self, *, - account_id: str | None = None, + account_id: str, disable_for_time: float | Omit = omit, external_emergency_signal_enabled: bool | Omit = omit, external_emergency_signal_fingerprint: str | Omit = omit, @@ -500,8 +488,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -533,7 +519,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -553,8 +539,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/devices/unrevoke.py b/src/cloudflare/resources/zero_trust/devices/unrevoke.py index ea114c46602..6d503f6cafa 100644 --- a/src/cloudflare/resources/zero_trust/devices/unrevoke.py +++ b/src/cloudflare/resources/zero_trust/devices/unrevoke.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> UnrevokeResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -124,7 +122,7 @@ def with_streaming_response(self) -> AsyncUnrevokeResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, body: SequenceNotStr[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. @@ -153,8 +151,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( diff --git a/src/cloudflare/resources/zero_trust/dex/colos.py b/src/cloudflare/resources/zero_trust/dex/colos.py index 7782a35ff01..ba8caaff060 100644 --- a/src/cloudflare/resources/zero_trust/dex/colos.py +++ b/src/cloudflare/resources/zero_trust/dex/colos.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> ColosResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, sort_by: Literal["fleet-status-usage", "application-tests-usage"] | Omit = omit, @@ -79,8 +79,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -127,7 +125,7 @@ def with_streaming_response(self) -> AsyncColosResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, sort_by: Literal["fleet-status-usage", "application-tests-usage"] | Omit = omit, @@ -159,8 +157,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/dex/commands/commands.py b/src/cloudflare/resources/zero_trust/dex/commands/commands.py index cda34c55732..84f0c0ed598 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/commands.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/commands.py @@ -87,7 +87,7 @@ def with_streaming_response(self) -> CommandsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, commands: Iterable[command_create_params.Command], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -110,8 +110,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -130,7 +128,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, command_type: str | Omit = omit, @@ -175,8 +173,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -240,7 +236,7 @@ def with_streaming_response(self) -> AsyncCommandsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, commands: Iterable[command_create_params.Command], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -263,8 +259,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -283,7 +277,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, command_type: str | Omit = omit, @@ -328,8 +322,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/dex/commands/devices.py b/src/cloudflare/resources/zero_trust/dex/commands/devices.py index 1f9e7b84f6c..02323f2d7d8 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/devices.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, search: str | Omit = omit, @@ -77,8 +77,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -125,7 +123,7 @@ def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, search: str | Omit = omit, @@ -155,8 +153,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py index 7638e1506e7..e3df1ee0218 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/downloads.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/downloads.py @@ -47,7 +47,7 @@ def get( self, filename: str, *, - account_id: str | None = None, + account_id: str, command_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. @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not command_id: @@ -118,7 +116,7 @@ async def get( self, filename: str, *, - account_id: str | None = None, + account_id: str, command_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. @@ -142,8 +140,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not command_id: diff --git a/src/cloudflare/resources/zero_trust/dex/commands/quota.py b/src/cloudflare/resources/zero_trust/dex/commands/quota.py index 86505bf8048..e89e5853a67 100644 --- a/src/cloudflare/resources/zero_trust/dex/commands/quota.py +++ b/src/cloudflare/resources/zero_trust/dex/commands/quota.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> QuotaResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -107,7 +105,7 @@ def with_streaming_response(self) -> AsyncQuotaResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -128,8 +126,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py index c066bee2c87..2921bea6d2b 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/devices.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> DevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, from_: str, page: float, per_page: float, @@ -110,8 +110,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -167,7 +165,7 @@ def with_streaming_response(self) -> AsyncDevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, from_: str, page: float, per_page: float, @@ -230,8 +228,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py index 82cf490b159..9ccee6a129b 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py @@ -60,7 +60,7 @@ def with_streaming_response(self) -> FleetStatusResourceWithStreamingResponse: def live( self, *, - account_id: str | None = None, + account_id: str, since_minutes: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -83,8 +83,6 @@ def live( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -103,7 +101,7 @@ def live( def over_time( self, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -135,8 +133,6 @@ def over_time( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -188,7 +184,7 @@ def with_streaming_response(self) -> AsyncFleetStatusResourceWithStreamingRespon async def live( self, *, - account_id: str | None = None, + account_id: str, since_minutes: float, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -211,8 +207,6 @@ async def live( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -233,7 +227,7 @@ async def live( async def over_time( self, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -265,8 +259,6 @@ async def over_time( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py index 466d21b40a2..1a93e810b25 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py @@ -61,7 +61,7 @@ def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, interval: Literal["minute", "hour"], to: str, @@ -101,8 +101,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -158,7 +156,7 @@ async def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, interval: Literal["minute", "hour"], to: str, @@ -198,8 +196,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py index 6ae59ef9f9b..db4efac7297 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py @@ -48,7 +48,7 @@ def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -85,8 +85,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -139,7 +137,7 @@ async def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -176,8 +174,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: diff --git a/src/cloudflare/resources/zero_trust/dex/rules.py b/src/cloudflare/resources/zero_trust/dex/rules.py index 503a8a567e4..db3b4ce4358 100644 --- a/src/cloudflare/resources/zero_trust/dex/rules.py +++ b/src/cloudflare/resources/zero_trust/dex/rules.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, description: str | Omit = omit, @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -108,7 +106,7 @@ def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, match: str | Omit = omit, name: str | Omit = omit, @@ -137,8 +135,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -166,7 +162,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, name: str | Omit = omit, @@ -201,8 +197,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -231,7 +225,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +247,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -275,7 +267,7 @@ def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -297,8 +289,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -339,7 +329,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, match: str, name: str, description: str | Omit = omit, @@ -366,8 +356,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -394,7 +382,7 @@ async def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, description: str | Omit = omit, match: str | Omit = omit, name: str | Omit = omit, @@ -423,8 +411,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -452,7 +438,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_id: str, page: float, per_page: float, name: str | Omit = omit, @@ -487,8 +473,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -517,7 +501,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -539,8 +523,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -561,7 +543,7 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -583,8 +565,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/zero_trust/dex/tests/tests.py b/src/cloudflare/resources/zero_trust/dex/tests/tests.py index 054db0cb00d..f2130d84b48 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/tests.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/tests.py @@ -62,7 +62,7 @@ def with_streaming_response(self) -> TestsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, colo: str | Omit = omit, device_id: SequenceNotStr[str] | Omit = omit, kind: Literal["http", "traceroute"] | Omit = omit, @@ -106,8 +106,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -162,7 +160,7 @@ def with_streaming_response(self) -> AsyncTestsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, colo: str | Omit = omit, device_id: SequenceNotStr[str] | Omit = omit, kind: Literal["http", "traceroute"] | Omit = omit, @@ -206,8 +204,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py index 9e6559cbf39..06ee76805e8 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> UniqueDevicesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, device_id: SequenceNotStr[str] | Omit = omit, test_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -75,8 +75,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -122,7 +120,7 @@ def with_streaming_response(self) -> AsyncUniqueDevicesResourceWithStreamingResp async def list( self, *, - account_id: str | None = None, + account_id: str, device_id: SequenceNotStr[str] | Omit = omit, test_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -150,8 +148,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py index 2e768a9f1bf..b061a59f743 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py @@ -47,7 +47,7 @@ def get( self, test_result_id: str, *, - account_id: str | None = None, + account_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, @@ -70,8 +70,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_result_id: @@ -117,7 +115,7 @@ async def get( self, test_result_id: str, *, - account_id: str | None = None, + account_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, @@ -140,8 +138,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_result_id: diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py index e64746956c1..7216f0f51db 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py @@ -55,7 +55,7 @@ def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, interval: Literal["minute", "hour"], to: str, @@ -95,8 +95,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -129,7 +127,7 @@ def network_path( self, test_id: str, *, - account_id: str | None = None, + account_id: str, device_id: str, from_: str, interval: Literal["minute", "hour"], @@ -163,8 +161,6 @@ def network_path( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -198,7 +194,7 @@ def percentiles( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -235,8 +231,6 @@ def percentiles( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -293,7 +287,7 @@ async def get( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, interval: Literal["minute", "hour"], to: str, @@ -333,8 +327,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -367,7 +359,7 @@ async def network_path( self, test_id: str, *, - account_id: str | None = None, + account_id: str, device_id: str, from_: str, interval: Literal["minute", "hour"], @@ -401,8 +393,6 @@ async def network_path( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: @@ -436,7 +426,7 @@ async def percentiles( self, test_id: str, *, - account_id: str | None = None, + account_id: str, from_: str, to: str, colo: str | Omit = omit, @@ -473,8 +463,6 @@ async def percentiles( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not test_id: diff --git a/src/cloudflare/resources/zero_trust/dex/warp_change_events.py b/src/cloudflare/resources/zero_trust/dex/warp_change_events.py index 63bc471f62f..d4ad3033aba 100644 --- a/src/cloudflare/resources/zero_trust/dex/warp_change_events.py +++ b/src/cloudflare/resources/zero_trust/dex/warp_change_events.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> WARPChangeEventsResourceWithStreamingRespon def get( self, *, - account_id: str | None = None, + account_id: str, from_: str, page: float, per_page: float, @@ -96,8 +96,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -150,7 +148,7 @@ def with_streaming_response(self) -> AsyncWARPChangeEventsResourceWithStreamingR async def get( self, *, - account_id: str | None = None, + account_id: str, from_: str, page: float, per_page: float, @@ -198,8 +196,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py index 5cfcf433421..837e0441a5a 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py @@ -73,7 +73,7 @@ def with_streaming_response(self) -> DatasetsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, case_sensitive: bool | Omit = omit, description: Optional[str] | Omit = omit, @@ -117,8 +117,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -147,7 +145,7 @@ def update( self, dataset_id: str, *, - account_id: str | None = None, + account_id: str, case_sensitive: bool | Omit = omit, description: Optional[str] | Omit = omit, name: Optional[str] | Omit = omit, @@ -179,8 +177,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -210,7 +206,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -231,8 +227,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -248,7 +242,7 @@ def delete( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -268,8 +262,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -289,7 +281,7 @@ def get( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -309,8 +301,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -361,7 +351,7 @@ def with_streaming_response(self) -> AsyncDatasetsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, case_sensitive: bool | Omit = omit, description: Optional[str] | Omit = omit, @@ -405,8 +395,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -435,7 +423,7 @@ async def update( self, dataset_id: str, *, - account_id: str | None = None, + account_id: str, case_sensitive: bool | Omit = omit, description: Optional[str] | Omit = omit, name: Optional[str] | Omit = omit, @@ -467,8 +455,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -498,7 +484,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -519,8 +505,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -536,7 +520,7 @@ async def delete( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -556,8 +540,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -577,7 +559,7 @@ async def get( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -597,8 +579,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py index a0605a01400..a60d5185c8d 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py @@ -59,7 +59,7 @@ def create( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -80,8 +80,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -105,7 +103,7 @@ def edit( version: int, dataset: FileContent | BinaryTypes, *, - account_id: str | None = None, + account_id: str, dataset_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. @@ -130,8 +128,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -180,7 +176,7 @@ async def create( self, dataset_id: str, *, - account_id: str | None = None, + account_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, @@ -201,8 +197,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -226,7 +220,7 @@ async def edit( version: int, dataset: FileContent | AsyncBinaryTypes, *, - account_id: str | None = None, + account_id: str, dataset_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. @@ -251,8 +245,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py index d12613f0ce8..a31c3136d84 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py @@ -59,7 +59,7 @@ def create( entry_id: str, dataset_version_entry: FileContent | BinaryTypes, *, - account_id: str | None = None, + account_id: str, dataset_id: str, version: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -139,7 +137,7 @@ async def create( entry_id: str, dataset_version_entry: FileContent | AsyncBinaryTypes, *, - account_id: str | None = None, + account_id: str, dataset_id: str, version: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -163,8 +161,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py index b29e0151103..0512e71dd45 100755 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py @@ -60,7 +60,7 @@ def create( self, version: int, *, - account_id: str | None = None, + account_id: str, dataset_id: str, body: Iterable[version_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -85,8 +85,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: @@ -136,7 +134,7 @@ def create( self, version: int, *, - account_id: str | None = None, + account_id: str, dataset_id: str, body: Iterable[version_create_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -161,8 +159,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not dataset_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py index 8ede4b5110e..ad57cb0d994 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/account_mapping.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> AccountMappingResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, auth_requirements: account_mapping_create_params.AuthRequirements, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -92,7 +90,7 @@ def create( def get( self, *, - account_id: str | None = None, + account_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, @@ -112,8 +110,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -152,7 +148,7 @@ def with_streaming_response(self) -> AsyncAccountMappingResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, auth_requirements: account_mapping_create_params.AuthRequirements, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -174,8 +170,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -196,7 +190,7 @@ async def create( async def get( self, *, - account_id: str | None = None, + account_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, @@ -216,8 +210,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dlp/email/rules.py b/src/cloudflare/resources/zero_trust/dlp/email/rules.py index 12272b39c5d..9309f274691 100644 --- a/src/cloudflare/resources/zero_trust/dlp/email/rules.py +++ b/src/cloudflare/resources/zero_trust/dlp/email/rules.py @@ -53,7 +53,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, action: rule_create_params.Action, conditions: Iterable[rule_create_params.Condition], enabled: bool, @@ -81,8 +81,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -111,7 +109,7 @@ def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, action: rule_update_params.Action, conditions: Iterable[rule_update_params.Condition], enabled: bool, @@ -138,8 +136,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -169,7 +165,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -189,8 +185,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -206,7 +200,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -228,8 +222,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -249,7 +241,7 @@ def delete( def bulk_edit( self, *, - account_id: str | None = None, + account_id: str, new_priorities: Dict[str, int], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -272,8 +264,6 @@ def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -293,7 +283,7 @@ def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -314,8 +304,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -356,7 +344,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, action: rule_create_params.Action, conditions: Iterable[rule_create_params.Condition], enabled: bool, @@ -384,8 +372,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -414,7 +400,7 @@ async def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, action: rule_update_params.Action, conditions: Iterable[rule_update_params.Condition], enabled: bool, @@ -441,8 +427,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -472,7 +456,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -492,8 +476,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -509,7 +491,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -531,8 +513,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -552,7 +532,7 @@ async def delete( async def bulk_edit( self, *, - account_id: str | None = None, + account_id: str, new_priorities: Dict[str, int], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -575,8 +555,6 @@ async def bulk_edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -598,7 +576,7 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -619,8 +597,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/custom.py b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py index 0d53d68b0c9..301ffac8f67 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> CustomResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -77,8 +77,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -107,7 +105,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -131,8 +129,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -163,7 +159,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -183,8 +179,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -200,7 +194,7 @@ def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -220,8 +214,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -242,7 +234,7 @@ def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -262,8 +254,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -311,7 +301,7 @@ def with_streaming_response(self) -> AsyncCustomResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -336,8 +326,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -366,7 +354,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -390,8 +378,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -422,7 +408,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -442,8 +428,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -459,7 +443,7 @@ async def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -479,8 +463,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -501,7 +483,7 @@ async def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -521,8 +503,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/entries.py b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py index 40348da9b0f..2ad42170335 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py @@ -89,7 +89,7 @@ def with_streaming_response(self) -> EntriesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -114,8 +114,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -145,7 +143,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, name: str, pattern: PatternParam, type: Literal["custom"], @@ -177,7 +175,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["predefined"], enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -206,7 +204,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["integration"], enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -230,12 +228,12 @@ def update( """ ... - @required_args(["name", "pattern", "type"], ["type"]) + @required_args(["account_id", "name", "pattern", "type"], ["account_id", "type"]) def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], @@ -248,8 +246,6 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -286,7 +282,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -306,8 +302,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -323,7 +317,7 @@ def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -343,8 +337,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -365,7 +357,7 @@ def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -385,8 +377,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -446,7 +436,7 @@ def with_streaming_response(self) -> AsyncEntriesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, name: str, pattern: PatternParam, @@ -471,8 +461,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -502,7 +490,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, name: str, pattern: PatternParam, type: Literal["custom"], @@ -534,7 +522,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["predefined"], enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -563,7 +551,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, type: Literal["integration"], enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -587,12 +575,12 @@ async def update( """ ... - @required_args(["name", "pattern", "type"], ["type"]) + @required_args(["account_id", "name", "pattern", "type"], ["account_id", "type"]) async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], @@ -605,8 +593,6 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[EntryUpdateResponse]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -643,7 +629,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -663,8 +649,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -680,7 +664,7 @@ async def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -700,8 +684,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -722,7 +704,7 @@ async def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -742,8 +724,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/integration.py b/src/cloudflare/resources/zero_trust/dlp/entries/integration.py index 2ed6f3a18d5..bc4a09863c5 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/integration.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/integration.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> IntegrationResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, entry_id: str, profile_id: Optional[str] | Omit = omit, @@ -78,8 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -106,7 +104,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,8 +125,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -151,7 +147,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -171,8 +167,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +182,7 @@ def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -209,8 +203,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -233,7 +225,7 @@ def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -302,7 +292,7 @@ def with_streaming_response(self) -> AsyncIntegrationResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, entry_id: str, profile_id: Optional[str] | Omit = omit, @@ -329,8 +319,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -357,7 +345,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -378,8 +366,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -402,7 +388,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -422,8 +408,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -439,7 +423,7 @@ async def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -460,8 +444,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -484,7 +466,7 @@ async def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -504,8 +486,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py b/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py index 82b26669caf..11555362ba1 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/predefined.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> PredefinedResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, entry_id: str, profile_id: Optional[str] | Omit = omit, @@ -78,8 +78,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -106,7 +104,7 @@ def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -127,8 +125,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -151,7 +147,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -171,8 +167,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -188,7 +182,7 @@ def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -209,8 +203,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -233,7 +225,7 @@ def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -302,7 +292,7 @@ def with_streaming_response(self) -> AsyncPredefinedResourceWithStreamingRespons async def create( self, *, - account_id: str | None = None, + account_id: str, enabled: bool, entry_id: str, profile_id: Optional[str] | Omit = omit, @@ -329,8 +319,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -357,7 +345,7 @@ async def update( self, entry_id: str, *, - account_id: str | None = None, + account_id: str, enabled: bool, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -378,8 +366,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -402,7 +388,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -422,8 +408,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -439,7 +423,7 @@ async def delete( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -460,8 +444,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: @@ -484,7 +466,7 @@ async def get( self, entry_id: str, *, - account_id: str | None = None, + account_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, @@ -504,8 +486,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not entry_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/limits.py b/src/cloudflare/resources/zero_trust/dlp/limits.py index 9efbe87a354..2f04b393fc5 100755 --- a/src/cloudflare/resources/zero_trust/dlp/limits.py +++ b/src/cloudflare/resources/zero_trust/dlp/limits.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> LimitsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -68,8 +68,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -108,7 +106,7 @@ def with_streaming_response(self) -> AsyncLimitsResourceWithStreamingResponse: async def list( self, *, - account_id: str | None = None, + account_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, @@ -130,8 +128,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dlp/patterns.py b/src/cloudflare/resources/zero_trust/dlp/patterns.py index 041ed9e0767..4bc212dbd6a 100644 --- a/src/cloudflare/resources/zero_trust/dlp/patterns.py +++ b/src/cloudflare/resources/zero_trust/dlp/patterns.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PatternsResourceWithStreamingResponse: def validate( self, *, - account_id: str | None = None, + account_id: str, regex: str, max_match_bytes: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,8 +83,6 @@ def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -130,7 +128,7 @@ def with_streaming_response(self) -> AsyncPatternsResourceWithStreamingResponse: async def validate( self, *, - account_id: str | None = None, + account_id: str, regex: str, max_match_bytes: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -166,8 +164,6 @@ async def validate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py index a65f87d88e5..c83a01437ff 100644 --- a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py +++ b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> PayloadLogsResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, masking_level: Literal["full", "partial", "clear", "default"] | Omit = omit, public_key: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -94,8 +94,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -120,7 +118,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -141,8 +139,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -181,7 +177,7 @@ def with_streaming_response(self) -> AsyncPayloadLogsResourceWithStreamingRespon async def update( self, *, - account_id: str | None = None, + account_id: str, masking_level: Literal["full", "partial", "clear", "default"] | Omit = omit, public_key: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -226,8 +222,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -252,7 +246,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -273,8 +267,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 069a84ff8e7..c4a34849086 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> CustomResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: int | Omit = omit, @@ -96,8 +96,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -138,7 +136,7 @@ def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, name: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: Optional[int] | Omit = omit, @@ -189,8 +187,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -237,7 +233,7 @@ def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -257,8 +253,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -281,7 +275,7 @@ def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -301,8 +295,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -352,7 +344,7 @@ def with_streaming_response(self) -> AsyncCustomResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: int | Omit = omit, @@ -400,8 +392,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -442,7 +432,7 @@ async def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, name: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: Optional[int] | Omit = omit, @@ -493,8 +483,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -541,7 +529,7 @@ async def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -561,8 +549,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -585,7 +571,7 @@ async def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -605,8 +591,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index fcad7445f8a..1397504c600 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -48,7 +48,7 @@ def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: Optional[int] | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, @@ -77,8 +77,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -114,7 +112,7 @@ def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -135,8 +133,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -161,7 +157,7 @@ def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -182,8 +178,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -229,7 +223,7 @@ async def update( self, profile_id: str, *, - account_id: str | None = None, + account_id: str, ai_context_enabled: bool | Omit = omit, allowed_match_count: Optional[int] | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, @@ -258,8 +252,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -295,7 +287,7 @@ async def delete( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -316,8 +308,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -342,7 +332,7 @@ async def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -363,8 +353,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py index 439052c213a..fb3f1292a31 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py @@ -72,7 +72,7 @@ def with_streaming_response(self) -> ProfilesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, all: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -96,8 +96,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -117,7 +115,7 @@ def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -137,8 +135,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: @@ -194,7 +190,7 @@ def with_streaming_response(self) -> AsyncProfilesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, all: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -218,8 +214,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -239,7 +233,7 @@ async def get( self, profile_id: str, *, - account_id: str | None = None, + account_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, @@ -259,8 +253,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not profile_id: diff --git a/src/cloudflare/resources/zero_trust/dlp/settings.py b/src/cloudflare/resources/zero_trust/dlp/settings.py index 4bea5d05912..779a9f1f8eb 100644 --- a/src/cloudflare/resources/zero_trust/dlp/settings.py +++ b/src/cloudflare/resources/zero_trust/dlp/settings.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SettingsResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, ai_context_analysis: Optional[bool] | Omit = omit, ocr: Optional[bool] | Omit = omit, payload_logging: setting_update_params.PayloadLogging | Omit = omit, @@ -78,8 +78,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -105,7 +103,7 @@ def update( def delete( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._delete( @@ -144,7 +140,7 @@ def delete( def edit( self, *, - account_id: str | None = None, + account_id: str, ai_context_analysis: Optional[bool] | Omit = omit, ocr: Optional[bool] | Omit = omit, payload_logging: setting_edit_params.PayloadLogging | Omit = omit, @@ -175,8 +171,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -202,7 +196,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -222,8 +216,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -262,7 +254,7 @@ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, ai_context_analysis: Optional[bool] | Omit = omit, ocr: Optional[bool] | Omit = omit, payload_logging: setting_update_params.PayloadLogging | Omit = omit, @@ -293,8 +285,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -320,7 +310,7 @@ async def update( async def delete( self, *, - account_id: str | None = None, + account_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, @@ -340,8 +330,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._delete( @@ -359,7 +347,7 @@ async def delete( async def edit( self, *, - account_id: str | None = None, + account_id: str, ai_context_analysis: Optional[bool] | Omit = omit, ocr: Optional[bool] | Omit = omit, payload_logging: setting_edit_params.PayloadLogging | Omit = omit, @@ -390,8 +378,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -417,7 +403,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -437,8 +423,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/gateway/app_types.py b/src/cloudflare/resources/zero_trust/gateway/app_types.py index 383b817b48c..560eb364a61 100644 --- a/src/cloudflare/resources/zero_trust/gateway/app_types.py +++ b/src/cloudflare/resources/zero_trust/gateway/app_types.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> AppTypesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -68,8 +68,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -105,7 +103,7 @@ def with_streaming_response(self) -> AsyncAppTypesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py index 13652e47755..dba6699cb54 100644 --- a/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py +++ b/src/cloudflare/resources/zero_trust/gateway/audit_ssh_settings.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> AuditSSHSettingsResourceWithStreamingRespon def update( self, *, - account_id: str | None = None, + account_id: str, public_key: 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. @@ -72,8 +72,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -94,7 +92,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -115,8 +113,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -134,7 +130,7 @@ def get( def rotate_seed( self, *, - account_id: str | None = None, + account_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, @@ -155,8 +151,6 @@ def rotate_seed( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -195,7 +189,7 @@ def with_streaming_response(self) -> AsyncAuditSSHSettingsResourceWithStreamingR async def update( self, *, - account_id: str | None = None, + account_id: str, public_key: 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. @@ -220,8 +214,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -242,7 +234,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -263,8 +255,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( @@ -282,7 +272,7 @@ async def get( async def rotate_seed( self, *, - account_id: str | None = None, + account_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, @@ -303,8 +293,6 @@ async def rotate_seed( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( diff --git a/src/cloudflare/resources/zero_trust/gateway/categories.py b/src/cloudflare/resources/zero_trust/gateway/categories.py index 05bf664bbe8..997346abfc2 100644 --- a/src/cloudflare/resources/zero_trust/gateway/categories.py +++ b/src/cloudflare/resources/zero_trust/gateway/categories.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> CategoriesResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_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, @@ -66,8 +66,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -103,7 +101,7 @@ def with_streaming_response(self) -> AsyncCategoriesResourceWithStreamingRespons def list( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/gateway/certificates.py b/src/cloudflare/resources/zero_trust/gateway/certificates.py index 14c5f82a093..1abced76be7 100644 --- a/src/cloudflare/resources/zero_trust/gateway/certificates.py +++ b/src/cloudflare/resources/zero_trust/gateway/certificates.py @@ -57,7 +57,7 @@ def with_streaming_response(self) -> CertificatesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, validity_period_days: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -105,7 +103,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -125,8 +123,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -142,7 +138,7 @@ def delete( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -166,8 +162,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -192,7 +186,7 @@ def activate( self, certificate_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -215,8 +209,6 @@ def activate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -242,7 +234,7 @@ def deactivate( self, certificate_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -265,8 +257,6 @@ def deactivate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -292,7 +282,7 @@ def get( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -314,8 +304,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -360,7 +348,7 @@ def with_streaming_response(self) -> AsyncCertificatesResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, validity_period_days: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -386,8 +374,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -408,7 +394,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -428,8 +414,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -445,7 +429,7 @@ async def delete( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -469,8 +453,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -495,7 +477,7 @@ async def activate( self, certificate_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -518,8 +500,6 @@ async def activate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -545,7 +525,7 @@ async def deactivate( self, certificate_id: str, *, - account_id: str | None = None, + account_id: str, body: object, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -568,8 +548,6 @@ async def deactivate( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: @@ -595,7 +573,7 @@ async def get( self, certificate_id: str, *, - account_id: str | None = None, + account_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, @@ -617,8 +595,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not certificate_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py index d48d5f01662..4adab59483a 100755 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py @@ -65,7 +65,7 @@ def with_streaming_response(self) -> ConfigurationsResourceWithStreamingResponse def update( self, *, - account_id: str | None = None, + account_id: str, settings: GatewayConfigurationSettingsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -88,8 +88,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -108,7 +106,7 @@ def update( def edit( self, *, - account_id: str | None = None, + account_id: str, settings: GatewayConfigurationSettingsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -135,8 +133,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._patch( @@ -155,7 +151,7 @@ def edit( def get( self, *, - account_id: str | None = None, + account_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, @@ -175,8 +171,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -219,7 +213,7 @@ def with_streaming_response(self) -> AsyncConfigurationsResourceWithStreamingRes async def update( self, *, - account_id: str | None = None, + account_id: str, settings: GatewayConfigurationSettingsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -242,8 +236,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -264,7 +256,7 @@ async def update( async def edit( self, *, - account_id: str | None = None, + account_id: str, settings: GatewayConfigurationSettingsParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -291,8 +283,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._patch( @@ -311,7 +301,7 @@ async def edit( async def get( self, *, - account_id: str | None = None, + account_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, @@ -331,8 +321,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py index ff3d826b37b..34cd289af03 100644 --- a/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py +++ b/src/cloudflare/resources/zero_trust/gateway/configurations/custom_certificate.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> CustomCertificateResourceWithStreamingRespo def get( self, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -104,7 +102,7 @@ def with_streaming_response(self) -> AsyncCustomCertificateResourceWithStreaming async def get( self, *, - account_id: str | None = None, + account_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, @@ -124,8 +122,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/gateway/gateway.py b/src/cloudflare/resources/zero_trust/gateway/gateway.py index 6dfa4f37913..fbc083d0868 100644 --- a/src/cloudflare/resources/zero_trust/gateway/gateway.py +++ b/src/cloudflare/resources/zero_trust/gateway/gateway.py @@ -179,7 +179,7 @@ def with_streaming_response(self) -> GatewayResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_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, @@ -199,8 +199,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -218,7 +216,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -238,8 +236,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -322,7 +318,7 @@ def with_streaming_response(self) -> AsyncGatewayResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_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, @@ -342,8 +338,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -361,7 +355,7 @@ async def create( async def list( self, *, - account_id: str | None = None, + account_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, @@ -381,8 +375,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/items.py b/src/cloudflare/resources/zero_trust/gateway/lists/items.py index 2a29b1b6b26..d56f3e2762d 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/items.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/items.py @@ -45,7 +45,7 @@ def list( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -109,7 +107,7 @@ def list( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -131,8 +129,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py index 4706f33c4c6..f8ba8c6a2fb 100644 --- a/src/cloudflare/resources/zero_trust/gateway/lists/lists.py +++ b/src/cloudflare/resources/zero_trust/gateway/lists/lists.py @@ -62,9 +62,9 @@ def with_streaming_response(self) -> ListsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"], + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"], description: str | Omit = omit, items: Iterable[list_create_params.Item] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -123,7 +121,7 @@ def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, name: str, description: str | Omit = omit, items: Iterable[list_update_params.Item] | Omit = omit, @@ -156,8 +154,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -185,8 +181,9 @@ def update( def list( self, *, - account_id: str | None = None, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"] | Omit = omit, + account_id: str, + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -208,8 +205,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -229,7 +224,7 @@ def delete( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -251,8 +246,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -273,7 +266,7 @@ def edit( self, list_id: str, *, - account_id: str | None = None, + account_id: str, append: Iterable[list_edit_params.Append] | Omit = omit, remove: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -301,8 +294,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -330,7 +321,7 @@ def get( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -352,8 +343,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -398,9 +387,9 @@ def with_streaming_response(self) -> AsyncListsResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"], + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"], description: str | Omit = omit, items: Iterable[list_create_params.Item] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -430,8 +419,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -459,7 +446,7 @@ async def update( self, list_id: str, *, - account_id: str | None = None, + account_id: str, name: str, description: str | Omit = omit, items: Iterable[list_update_params.Item] | Omit = omit, @@ -492,8 +479,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -521,8 +506,9 @@ async def update( def list( self, *, - account_id: str | None = None, - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"] | Omit = omit, + account_id: str, + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"] + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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,8 +530,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -565,7 +549,7 @@ async def delete( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -587,8 +571,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -609,7 +591,7 @@ async def edit( self, list_id: str, *, - account_id: str | None = None, + account_id: str, append: Iterable[list_edit_params.Append] | Omit = omit, remove: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -637,8 +619,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: @@ -666,7 +646,7 @@ async def get( self, list_id: str, *, - account_id: str | None = None, + account_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, @@ -688,8 +668,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not list_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/locations.py b/src/cloudflare/resources/zero_trust/gateway/locations.py index 702141f159f..ce667d51fe4 100644 --- a/src/cloudflare/resources/zero_trust/gateway/locations.py +++ b/src/cloudflare/resources/zero_trust/gateway/locations.py @@ -49,7 +49,7 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, client_default: bool | Omit = omit, dns_destination_ips_id: str | Omit = omit, @@ -93,8 +93,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -124,7 +122,7 @@ def update( self, location_id: str, *, - account_id: str | None = None, + account_id: str, name: str, client_default: bool | Omit = omit, dns_destination_ips_id: str | Omit = omit, @@ -168,8 +166,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: @@ -202,7 +198,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -222,8 +218,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -239,7 +233,7 @@ def delete( self, location_id: str, *, - account_id: str | None = None, + account_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, @@ -259,8 +253,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: @@ -283,7 +275,7 @@ def get( self, location_id: str, *, - account_id: str | None = None, + account_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, @@ -303,8 +295,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: @@ -347,7 +337,7 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, client_default: bool | Omit = omit, dns_destination_ips_id: str | Omit = omit, @@ -391,8 +381,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -422,7 +410,7 @@ async def update( self, location_id: str, *, - account_id: str | None = None, + account_id: str, name: str, client_default: bool | Omit = omit, dns_destination_ips_id: str | Omit = omit, @@ -466,8 +454,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: @@ -500,7 +486,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -520,8 +506,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -537,7 +521,7 @@ async def delete( self, location_id: str, *, - account_id: str | None = None, + account_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, @@ -557,8 +541,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: @@ -581,7 +563,7 @@ async def get( self, location_id: str, *, - account_id: str | None = None, + account_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, @@ -601,8 +583,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not location_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/logging.py b/src/cloudflare/resources/zero_trust/gateway/logging.py index 0e324913b98..9b6a07999ba 100644 --- a/src/cloudflare/resources/zero_trust/gateway/logging.py +++ b/src/cloudflare/resources/zero_trust/gateway/logging.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> LoggingResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, redact_pii: bool | Omit = omit, settings_by_rule_type: logging_update_params.SettingsByRuleType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -75,8 +75,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -101,7 +99,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -121,8 +119,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -161,7 +157,7 @@ def with_streaming_response(self) -> AsyncLoggingResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, redact_pii: bool | Omit = omit, settings_by_rule_type: logging_update_params.SettingsByRuleType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -189,8 +185,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -215,7 +209,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -235,8 +229,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/gateway/pacfiles.py b/src/cloudflare/resources/zero_trust/gateway/pacfiles.py index 87c374d45df..e61309c5302 100644 --- a/src/cloudflare/resources/zero_trust/gateway/pacfiles.py +++ b/src/cloudflare/resources/zero_trust/gateway/pacfiles.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> PacfilesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, contents: str, name: str, description: str | Omit = omit, @@ -84,8 +84,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -113,7 +111,7 @@ def update( self, pacfile_id: str, *, - account_id: str | None = None, + account_id: str, contents: str, description: str, name: str, @@ -142,8 +140,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: @@ -173,7 +169,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -193,8 +189,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -210,7 +204,7 @@ def delete( self, pacfile_id: str, *, - account_id: str | None = None, + account_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, @@ -230,8 +224,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: @@ -254,7 +246,7 @@ def get( self, pacfile_id: str, *, - account_id: str | None = None, + account_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, @@ -274,8 +266,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: @@ -318,7 +308,7 @@ def with_streaming_response(self) -> AsyncPacfilesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, contents: str, name: str, description: str | Omit = omit, @@ -351,8 +341,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -380,7 +368,7 @@ async def update( self, pacfile_id: str, *, - account_id: str | None = None, + account_id: str, contents: str, description: str, name: str, @@ -409,8 +397,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: @@ -440,7 +426,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -460,8 +446,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -477,7 +461,7 @@ async def delete( self, pacfile_id: str, *, - account_id: str | None = None, + account_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, @@ -497,8 +481,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: @@ -521,7 +503,7 @@ async def get( self, pacfile_id: str, *, - account_id: str | None = None, + account_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, @@ -541,8 +523,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not pacfile_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py index 58288c2d62b..ecd4260e254 100644 --- a/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py +++ b/src/cloudflare/resources/zero_trust/gateway/proxy_endpoints.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> ProxyEndpointsResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, name: str, kind: Literal["ip"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -83,7 +83,7 @@ def create( def create( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["identity"], name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -111,11 +111,11 @@ def create( """ ... - @required_args(["name"], ["kind", "name"]) + @required_args(["account_id", "name"], ["account_id", "kind", "name"]) def create( self, *, - account_id: str | None = None, + account_id: str, name: str, kind: Literal["ip"] | Literal["identity"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -125,8 +125,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -156,7 +154,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -176,8 +174,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -193,7 +189,7 @@ def delete( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_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, @@ -213,8 +209,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: @@ -239,7 +233,7 @@ def edit( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_id: str, ips: SequenceNotStr[GatewayIPs] | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -265,8 +259,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: @@ -303,7 +295,7 @@ def get( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_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, @@ -323,8 +315,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: @@ -375,7 +365,7 @@ def with_streaming_response(self) -> AsyncProxyEndpointsResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, kind: Literal["ip"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -407,7 +397,7 @@ async def create( async def create( self, *, - account_id: str | None = None, + account_id: str, kind: Literal["identity"], name: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -435,11 +425,11 @@ async def create( """ ... - @required_args(["name"], ["kind", "name"]) + @required_args(["account_id", "name"], ["account_id", "kind", "name"]) async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, kind: Literal["ip"] | Literal["identity"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -449,8 +439,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ProxyEndpoint]: - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( @@ -480,7 +468,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_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, @@ -500,8 +488,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -517,7 +503,7 @@ async def delete( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_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, @@ -537,8 +523,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: @@ -563,7 +547,7 @@ async def edit( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_id: str, ips: SequenceNotStr[GatewayIPs] | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -589,8 +573,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: @@ -627,7 +609,7 @@ async def get( self, proxy_endpoint_id: str, *, - account_id: str | None = None, + account_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, @@ -647,8 +629,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not proxy_endpoint_id: diff --git a/src/cloudflare/resources/zero_trust/gateway/rules.py b/src/cloudflare/resources/zero_trust/gateway/rules.py index f3d4299f341..162dd207c08 100644 --- a/src/cloudflare/resources/zero_trust/gateway/rules.py +++ b/src/cloudflare/resources/zero_trust/gateway/rules.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> RulesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, action: Literal[ "on", "off", @@ -146,8 +146,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -183,7 +181,7 @@ def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal[ "on", "off", @@ -279,8 +277,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -317,7 +313,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -337,8 +333,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -354,7 +348,7 @@ def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -376,8 +370,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -398,7 +390,7 @@ def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -420,8 +412,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -441,7 +431,7 @@ def get( def list_tenant( self, *, - account_id: str | None = None, + account_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, @@ -462,8 +452,6 @@ def list_tenant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -479,7 +467,7 @@ def reset_expiration( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -503,8 +491,6 @@ def reset_expiration( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -549,7 +535,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, action: Literal[ "on", "off", @@ -643,8 +629,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -680,7 +664,7 @@ async def update( self, rule_id: str, *, - account_id: str | None = None, + account_id: str, action: Literal[ "on", "off", @@ -776,8 +760,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -814,7 +796,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -834,8 +816,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -851,7 +831,7 @@ async def delete( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -873,8 +853,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -895,7 +873,7 @@ async def get( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -917,8 +895,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: @@ -938,7 +914,7 @@ async def get( def list_tenant( self, *, - account_id: str | None = None, + account_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, @@ -959,8 +935,6 @@ def list_tenant( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -976,7 +950,7 @@ async def reset_expiration( self, rule_id: str, *, - account_id: str | None = None, + account_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, @@ -1000,8 +974,6 @@ async def reset_expiration( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not rule_id: diff --git a/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py b/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py index 506bb5d8ff1..a45873d71c3 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/identity_providers.py @@ -75,8 +75,8 @@ def create( config: identity_provider_create_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -123,8 +123,8 @@ def create( config: identity_provider_create_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -171,8 +171,8 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -219,8 +219,8 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -267,8 +267,8 @@ def create( config: identity_provider_create_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -315,8 +315,8 @@ def create( config: identity_provider_create_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -363,8 +363,8 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -411,8 +411,8 @@ def create( config: identity_provider_create_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -459,8 +459,8 @@ def create( config: identity_provider_create_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -507,8 +507,8 @@ def create( config: identity_provider_create_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -555,8 +555,8 @@ def create( config: identity_provider_create_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -603,8 +603,8 @@ def create( config: identity_provider_create_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -651,8 +651,8 @@ def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -699,8 +699,8 @@ def create( config: identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -757,8 +757,8 @@ def create( | identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -767,10 +767,6 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -821,8 +817,8 @@ def update( config: identity_provider_update_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -872,8 +868,8 @@ def update( config: identity_provider_update_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -923,8 +919,8 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -974,8 +970,8 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1025,8 +1021,8 @@ def update( config: identity_provider_update_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1076,8 +1072,8 @@ def update( config: identity_provider_update_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1127,8 +1123,8 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1178,8 +1174,8 @@ def update( config: identity_provider_update_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1229,8 +1225,8 @@ def update( config: identity_provider_update_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1280,8 +1276,8 @@ def update( config: identity_provider_update_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1331,8 +1327,8 @@ def update( config: identity_provider_update_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1382,8 +1378,8 @@ def update( config: identity_provider_update_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1433,8 +1429,8 @@ def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1484,8 +1480,8 @@ def update( config: identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1545,8 +1541,8 @@ def update( | identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1559,10 +1555,6 @@ def update( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1609,8 +1601,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, scim_enabled: str | Omit = omit, @@ -1644,10 +1636,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1690,8 +1678,8 @@ def delete( self, identity_provider_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1721,10 +1709,6 @@ def delete( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1758,8 +1742,8 @@ def get( self, identity_provider_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1789,10 +1773,6 @@ def get( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -1859,8 +1839,8 @@ async def create( config: identity_provider_create_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1907,8 +1887,8 @@ async def create( config: identity_provider_create_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1955,8 +1935,8 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2003,8 +1983,8 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2051,8 +2031,8 @@ async def create( config: identity_provider_create_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2099,8 +2079,8 @@ async def create( config: identity_provider_create_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2147,8 +2127,8 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2195,8 +2175,8 @@ async def create( config: identity_provider_create_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2243,8 +2223,8 @@ async def create( config: identity_provider_create_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2291,8 +2271,8 @@ async def create( config: identity_provider_create_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2339,8 +2319,8 @@ async def create( config: identity_provider_create_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2387,8 +2367,8 @@ async def create( config: identity_provider_create_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2435,8 +2415,8 @@ async def create( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2483,8 +2463,8 @@ async def create( config: identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2541,8 +2521,8 @@ async def create( | identity_provider_create_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2551,10 +2531,6 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IdentityProvider]: - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -2605,8 +2581,8 @@ async def update( config: identity_provider_update_params.AzureADConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2656,8 +2632,8 @@ async def update( config: identity_provider_update_params.AccessCentrifyConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2707,8 +2683,8 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2758,8 +2734,8 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2809,8 +2785,8 @@ async def update( config: identity_provider_update_params.AccessGoogleConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2860,8 +2836,8 @@ async def update( config: identity_provider_update_params.AccessGoogleAppsConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2911,8 +2887,8 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2962,8 +2938,8 @@ async def update( config: identity_provider_update_params.AccessOIDCConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3013,8 +2989,8 @@ async def update( config: identity_provider_update_params.AccessOktaConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3064,8 +3040,8 @@ async def update( config: identity_provider_update_params.AccessOneloginConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3115,8 +3091,8 @@ async def update( config: identity_provider_update_params.AccessPingoneConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3166,8 +3142,8 @@ async def update( config: identity_provider_update_params.AccessSAMLConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3217,8 +3193,8 @@ async def update( config: GenericOAuthConfigParam, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3268,8 +3244,8 @@ async def update( config: identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3329,8 +3305,8 @@ async def update( | identity_provider_update_params.AccessOnetimepinConfig, name: str, type: IdentityProviderType, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, scim_config: IdentityProviderSCIMConfigParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3343,10 +3319,6 @@ async def update( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3393,8 +3365,8 @@ async def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, scim_enabled: str | Omit = omit, @@ -3428,10 +3400,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3474,8 +3442,8 @@ async def delete( self, identity_provider_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3505,10 +3473,6 @@ async def delete( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -3542,8 +3506,8 @@ async def get( self, identity_provider_id: str, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -3573,10 +3537,6 @@ async def get( raise ValueError( f"Expected a non-empty value for `identity_provider_id` but received {identity_provider_id!r}" ) - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py index 9ff4766eb32..4fdf8cb5bea 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/groups.py @@ -46,7 +46,7 @@ def list( self, identity_provider_id: str, *, - account_id: str | None = None, + account_id: str, cf_resource_id: str | Omit = omit, idp_resource_id: str | Omit = omit, name: str | Omit = omit, @@ -88,8 +88,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identity_provider_id: @@ -147,7 +145,7 @@ def list( self, identity_provider_id: str, *, - account_id: str | None = None, + account_id: str, cf_resource_id: str | Omit = omit, idp_resource_id: str | Omit = omit, name: str | Omit = omit, @@ -189,8 +187,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identity_provider_id: diff --git a/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py b/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py index 46e4d4d3e12..e746cce4ace 100644 --- a/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py +++ b/src/cloudflare/resources/zero_trust/identity_providers/scim/users.py @@ -46,7 +46,7 @@ def list( self, identity_provider_id: str, *, - account_id: str | None = None, + account_id: str, cf_resource_id: str | Omit = omit, email: str | Omit = omit, idp_resource_id: str | Omit = omit, @@ -93,8 +93,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identity_provider_id: @@ -154,7 +152,7 @@ def list( self, identity_provider_id: str, *, - account_id: str | None = None, + account_id: str, cf_resource_id: str | Omit = omit, email: str | Omit = omit, idp_resource_id: str | Omit = omit, @@ -201,8 +199,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not identity_provider_id: diff --git a/src/cloudflare/resources/zero_trust/networks/hostname_routes.py b/src/cloudflare/resources/zero_trust/networks/hostname_routes.py index f28e495da54..4efddb80dd7 100644 --- a/src/cloudflare/resources/zero_trust/networks/hostname_routes.py +++ b/src/cloudflare/resources/zero_trust/networks/hostname_routes.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> HostnameRoutesResourceWithStreamingResponse def create( self, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, hostname: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -83,8 +83,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -110,7 +108,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, comment: str | Omit = omit, existed_at: str | Omit = omit, @@ -159,8 +157,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -192,7 +188,7 @@ def delete( self, hostname_route_id: str, *, - account_id: str | None = None, + account_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, @@ -216,8 +212,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: @@ -242,7 +236,7 @@ def edit( self, hostname_route_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, hostname: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -275,8 +269,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: @@ -309,7 +301,7 @@ def get( self, hostname_route_id: str, *, - account_id: str | None = None, + account_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, @@ -333,8 +325,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: @@ -379,7 +369,7 @@ def with_streaming_response(self) -> AsyncHostnameRoutesResourceWithStreamingRes async def create( self, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, hostname: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -410,8 +400,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -437,7 +425,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, comment: str | Omit = omit, existed_at: str | Omit = omit, @@ -486,8 +474,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -519,7 +505,7 @@ async def delete( self, hostname_route_id: str, *, - account_id: str | None = None, + account_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, @@ -543,8 +529,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: @@ -569,7 +553,7 @@ async def edit( self, hostname_route_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, hostname: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -602,8 +586,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: @@ -636,7 +618,7 @@ async def get( self, hostname_route_id: str, *, - account_id: str | None = None, + account_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, @@ -660,8 +642,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not hostname_route_id: diff --git a/src/cloudflare/resources/zero_trust/networks/routes/ips.py b/src/cloudflare/resources/zero_trust/networks/routes/ips.py index 15cc702a085..9f067af6020 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/ips.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/ips.py @@ -48,7 +48,7 @@ def get( self, ip: str, *, - account_id: str | None = None, + account_id: str, default_virtual_network_fallback: bool | Omit = omit, virtual_network_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip: @@ -129,7 +127,7 @@ async def get( self, ip: str, *, - account_id: str | None = None, + account_id: str, default_virtual_network_fallback: bool | Omit = omit, virtual_network_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -160,8 +158,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip: diff --git a/src/cloudflare/resources/zero_trust/networks/routes/networks.py b/src/cloudflare/resources/zero_trust/networks/routes/networks.py index 86db38982d4..e8c02012f90 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/networks.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/networks.py @@ -53,7 +53,7 @@ def create( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_id: str, tunnel_id: str, comment: str | Omit = omit, virtual_network_id: str | Omit = omit, @@ -88,8 +88,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: @@ -125,7 +123,7 @@ def delete( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_id: str, tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] | Omit = omit, tunnel_id: str | Omit = omit, virtual_network_id: str | Omit = omit, @@ -165,8 +163,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: @@ -202,7 +198,7 @@ def edit( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_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, @@ -228,8 +224,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: @@ -278,7 +272,7 @@ async def create( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_id: str, tunnel_id: str, comment: str | Omit = omit, virtual_network_id: str | Omit = omit, @@ -313,8 +307,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: @@ -350,7 +342,7 @@ async def delete( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_id: str, tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] | Omit = omit, tunnel_id: str | Omit = omit, virtual_network_id: str | Omit = omit, @@ -390,8 +382,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: @@ -427,7 +417,7 @@ async def edit( self, ip_network_encoded: str, *, - account_id: str | None = None, + account_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, @@ -453,8 +443,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not ip_network_encoded: diff --git a/src/cloudflare/resources/zero_trust/networks/routes/routes.py b/src/cloudflare/resources/zero_trust/networks/routes/routes.py index efe10473e5f..a66395ff989 100644 --- a/src/cloudflare/resources/zero_trust/networks/routes/routes.py +++ b/src/cloudflare/resources/zero_trust/networks/routes/routes.py @@ -74,7 +74,7 @@ def with_streaming_response(self) -> RoutesResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, network: str, tunnel_id: str, comment: str | Omit = omit, @@ -108,8 +108,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -136,7 +134,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, existed_at: str | Omit = omit, is_deleted: bool | Omit = omit, @@ -193,8 +191,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -229,7 +225,7 @@ def delete( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -253,8 +249,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -275,7 +269,7 @@ def edit( self, route_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, network: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -313,8 +307,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -344,7 +336,7 @@ def get( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -368,8 +360,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -418,7 +408,7 @@ def with_streaming_response(self) -> AsyncRoutesResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, network: str, tunnel_id: str, comment: str | Omit = omit, @@ -452,8 +442,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -480,7 +468,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, existed_at: str | Omit = omit, is_deleted: bool | Omit = omit, @@ -537,8 +525,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -573,7 +559,7 @@ async def delete( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -597,8 +583,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -619,7 +603,7 @@ async def edit( self, route_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, network: str | Omit = omit, tunnel_id: str | Omit = omit, @@ -657,8 +641,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: @@ -688,7 +670,7 @@ async def get( self, route_id: str, *, - account_id: str | None = None, + account_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, @@ -712,8 +694,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not route_id: diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py index a272e7878b2..727d942e303 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py @@ -49,7 +49,7 @@ def update( self, address_family: Literal["v4", "v6"], *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, name: str | Omit = omit, network: str | Omit = omit, @@ -82,8 +82,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_family: @@ -137,7 +135,7 @@ async def update( self, address_family: Literal["v4", "v6"], *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, name: str | Omit = omit, network: str | Omit = omit, @@ -170,8 +168,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not address_family: diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py index 6c3a1ebf0ef..f45223266ad 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py @@ -71,7 +71,7 @@ def with_streaming_response(self) -> SubnetsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, address_family: Literal["v4", "v6"] | Omit = omit, comment: str | Omit = omit, existed_at: str | Omit = omit, @@ -130,8 +130,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -194,7 +192,7 @@ def with_streaming_response(self) -> AsyncSubnetsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, address_family: Literal["v4", "v6"] | Omit = omit, comment: str | Omit = omit, existed_at: str | Omit = omit, @@ -253,8 +251,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/warp.py b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py index 1db2485eba5..524c6b9d508 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/warp.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> WARPResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, network: str, comment: str | Omit = omit, @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -123,7 +121,7 @@ def delete( self, subnet_id: str, *, - account_id: str | None = None, + account_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, @@ -149,8 +147,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: @@ -173,7 +169,7 @@ def edit( self, subnet_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, is_default_network: bool | Omit = omit, name: str | Omit = omit, @@ -216,8 +212,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: @@ -249,7 +243,7 @@ def get( self, subnet_id: str, *, - account_id: str | None = None, + account_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, @@ -273,8 +267,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: @@ -317,7 +309,7 @@ def with_streaming_response(self) -> AsyncWARPResourceWithStreamingResponse: async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, network: str, comment: str | Omit = omit, @@ -363,8 +355,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -392,7 +382,7 @@ async def delete( self, subnet_id: str, *, - account_id: str | None = None, + account_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, @@ -418,8 +408,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: @@ -442,7 +430,7 @@ async def edit( self, subnet_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, is_default_network: bool | Omit = omit, name: str | Omit = omit, @@ -485,8 +473,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: @@ -518,7 +504,7 @@ async def get( self, subnet_id: str, *, - account_id: str | None = None, + account_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, @@ -542,8 +528,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not subnet_id: diff --git a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py index 41aab662a14..07a156b2050 100644 --- a/src/cloudflare/resources/zero_trust/networks/virtual_networks.py +++ b/src/cloudflare/resources/zero_trust/networks/virtual_networks.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> VirtualNetworksResourceWithStreamingRespons def create( self, *, - account_id: str | None = None, + account_id: str, name: str, comment: str | Omit = omit, is_default: bool | Omit = omit, @@ -86,8 +86,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -114,7 +112,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, is_default: bool | Omit = omit, is_default_network: bool | Omit = omit, @@ -154,8 +152,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -184,7 +180,7 @@ def delete( self, virtual_network_id: str, *, - account_id: str | None = None, + account_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, @@ -208,8 +204,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: @@ -234,7 +228,7 @@ def edit( self, virtual_network_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, is_default_network: bool | Omit = omit, name: str | Omit = omit, @@ -267,8 +261,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: @@ -301,7 +293,7 @@ def get( self, virtual_network_id: str, *, - account_id: str | None = None, + account_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, @@ -325,8 +317,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: @@ -371,7 +361,7 @@ def with_streaming_response(self) -> AsyncVirtualNetworksResourceWithStreamingRe async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, comment: str | Omit = omit, is_default: bool | Omit = omit, @@ -405,8 +395,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -433,7 +421,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, id: str | Omit = omit, is_default: bool | Omit = omit, is_default_network: bool | Omit = omit, @@ -473,8 +461,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -503,7 +489,7 @@ async def delete( self, virtual_network_id: str, *, - account_id: str | None = None, + account_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, @@ -527,8 +513,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: @@ -553,7 +537,7 @@ async def edit( self, virtual_network_id: str, *, - account_id: str | None = None, + account_id: str, comment: str | Omit = omit, is_default_network: bool | Omit = omit, name: str | Omit = omit, @@ -586,8 +570,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: @@ -620,7 +602,7 @@ async def get( self, virtual_network_id: str, *, - account_id: str | None = None, + account_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, @@ -644,8 +626,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not virtual_network_id: diff --git a/src/cloudflare/resources/zero_trust/organizations/doh.py b/src/cloudflare/resources/zero_trust/organizations/doh.py index ef7778068e9..9791b4f39b0 100644 --- a/src/cloudflare/resources/zero_trust/organizations/doh.py +++ b/src/cloudflare/resources/zero_trust/organizations/doh.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> DOHResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, doh_jwt_duration: str | Omit = omit, service_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -105,7 +103,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -167,7 +163,7 @@ def with_streaming_response(self) -> AsyncDOHResourceWithStreamingResponse: async def update( self, *, - account_id: str | None = None, + account_id: str, doh_jwt_duration: str | Omit = omit, service_token_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -198,8 +194,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -224,7 +218,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -246,8 +240,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index fce39c1b0f9..731117bb8a5 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -67,8 +67,8 @@ def create( *, auth_domain: str, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, deny_unmatched_requests: bool | Omit = omit, @@ -152,10 +152,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -207,8 +203,8 @@ def create( def update( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, auth_domain: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -295,10 +291,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -351,8 +343,8 @@ def update( def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,10 +368,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -412,8 +400,8 @@ def revoke_users( self, *, email: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, query_devices: bool | Omit = omit, body_devices: bool | Omit = omit, user_uid: str | Omit = omit, @@ -453,10 +441,6 @@ def revoke_users( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -529,8 +513,8 @@ async def create( *, auth_domain: str, name: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, deny_unmatched_requests: bool | Omit = omit, @@ -614,10 +598,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -669,8 +649,8 @@ async def create( async def update( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, auth_domain: str | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, @@ -757,10 +737,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -813,8 +789,8 @@ async def update( async def list( self, *, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -838,10 +814,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") @@ -874,8 +846,8 @@ async def revoke_users( self, *, email: str, - account_id: str | None = None, - zone_id: str | None = None, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, query_devices: bool | Omit = omit, body_devices: bool | Omit = omit, user_uid: str | Omit = omit, @@ -915,10 +887,6 @@ async def revoke_users( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if account_id and zone_id: raise ValueError("You cannot provide both account_id and zone_id") diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py index 584759cc3e4..12f608c15ee 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/behaviours.py @@ -48,7 +48,7 @@ def with_streaming_response(self) -> BehavioursResourceWithStreamingResponse: def update( self, *, - account_id: str | None = None, + account_id: str, behaviors: Dict[str, behaviour_update_params.Behaviors], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -70,8 +70,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( @@ -90,7 +88,7 @@ def update( def get( self, *, - account_id: str | None = None, + account_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, @@ -111,8 +109,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -151,7 +147,7 @@ def with_streaming_response(self) -> AsyncBehavioursResourceWithStreamingRespons async def update( self, *, - account_id: str | None = None, + account_id: str, behaviors: Dict[str, behaviour_update_params.Behaviors], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -173,8 +169,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._put( @@ -193,7 +187,7 @@ async def update( async def get( self, *, - account_id: str | None = None, + account_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, @@ -214,8 +208,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py index 0e0219d4109..3ec25a3c90b 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/integrations.py @@ -64,7 +64,7 @@ def with_streaming_response(self) -> IntegrationsResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, integration_type: Literal["Okta"], tenant_url: str, reference_id: Optional[str] | Omit = omit, @@ -94,8 +94,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -122,7 +120,7 @@ def update( self, integration_id: str, *, - account_id: str | None = None, + account_id: str, active: bool, tenant_url: str, reference_id: Optional[str] | Omit = omit, @@ -155,8 +153,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -188,7 +184,7 @@ def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -208,8 +204,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -225,7 +219,7 @@ def delete( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -246,8 +240,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -272,7 +264,7 @@ def get( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -292,8 +284,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -342,7 +332,7 @@ def with_streaming_response(self) -> AsyncIntegrationsResourceWithStreamingRespo async def create( self, *, - account_id: str | None = None, + account_id: str, integration_type: Literal["Okta"], tenant_url: str, reference_id: Optional[str] | Omit = omit, @@ -372,8 +362,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -400,7 +388,7 @@ async def update( self, integration_id: str, *, - account_id: str | None = None, + account_id: str, active: bool, tenant_url: str, reference_id: Optional[str] | Omit = omit, @@ -433,8 +421,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -466,7 +452,7 @@ async def update( def list( self, *, - account_id: str | None = None, + account_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, @@ -486,8 +472,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -503,7 +487,7 @@ async def delete( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -524,8 +508,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: @@ -550,7 +532,7 @@ async def get( self, integration_id: str, *, - account_id: str | None = None, + account_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, @@ -570,8 +552,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not integration_id: diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py index 3e656564654..418141c913e 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/integrations/references.py @@ -47,7 +47,7 @@ def get( self, reference_id: str, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not reference_id: @@ -114,7 +112,7 @@ async def get( self, reference_id: str, *, - account_id: str | None = None, + account_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, @@ -134,8 +132,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not reference_id: diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py b/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py index 75daf868585..35c95321744 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/risk_scoring.py @@ -83,7 +83,7 @@ def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -104,8 +104,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -126,7 +124,7 @@ def reset( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -146,8 +144,6 @@ def reset( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -203,7 +199,7 @@ async def get( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -224,8 +220,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: @@ -246,7 +240,7 @@ async def reset( self, user_id: str, *, - account_id: str | None = None, + account_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, @@ -266,8 +260,6 @@ async def reset( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not user_id: diff --git a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py index 00e304edb7f..491c71cec4a 100644 --- a/src/cloudflare/resources/zero_trust/risk_scoring/summary.py +++ b/src/cloudflare/resources/zero_trust/risk_scoring/summary.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> SummaryResourceWithStreamingResponse: def get( self, *, - account_id: str | None = None, + account_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, @@ -67,8 +67,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get( @@ -107,7 +105,7 @@ def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse: async def get( self, *, - account_id: str | None = None, + account_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, @@ -128,8 +126,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zero_trust/seats.py b/src/cloudflare/resources/zero_trust/seats.py index 2f46fcb8214..c5ef920b4c1 100644 --- a/src/cloudflare/resources/zero_trust/seats.py +++ b/src/cloudflare/resources/zero_trust/seats.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> SeatsResourceWithStreamingResponse: def edit( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[seat_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,8 +71,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -110,7 +108,7 @@ def with_streaming_response(self) -> AsyncSeatsResourceWithStreamingResponse: def edit( self, *, - account_id: str | None = None, + account_id: str, body: Iterable[seat_edit_params.Body], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -134,8 +132,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py index 8e6d5fc122b..538ed6aefe7 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/cloudflared.py @@ -110,7 +110,7 @@ def with_streaming_response(self) -> CloudflaredResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, config_src: Literal["local", "cloudflare"] | Omit = omit, tunnel_secret: str | Omit = omit, @@ -144,8 +144,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -171,7 +169,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -223,8 +221,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -259,7 +255,7 @@ def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -283,8 +279,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -305,7 +299,7 @@ def edit( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, tunnel_secret: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -336,8 +330,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -365,7 +357,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -389,8 +381,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -451,7 +441,7 @@ def with_streaming_response(self) -> AsyncCloudflaredResourceWithStreamingRespon async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, config_src: Literal["local", "cloudflare"] | Omit = omit, tunnel_secret: str | Omit = omit, @@ -485,8 +475,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -512,7 +500,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -564,8 +552,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -600,7 +586,7 @@ async def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -624,8 +610,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -646,7 +630,7 @@ async def edit( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, tunnel_secret: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -677,8 +661,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -706,7 +688,7 @@ async def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -730,8 +712,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py index 1eea6f11433..377a2f02a28 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/configurations.py @@ -49,7 +49,7 @@ def update( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, config: configuration_update_params.Config | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -103,7 +101,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -127,8 +125,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -174,7 +170,7 @@ async def update( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, config: configuration_update_params.Config | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -201,8 +197,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -228,7 +222,7 @@ async def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -252,8 +246,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py index 05199a2c228..190346949d8 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connections.py @@ -49,7 +49,7 @@ def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, client_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -79,8 +79,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -104,7 +102,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -128,8 +126,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -170,7 +166,7 @@ async def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, client_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -200,8 +196,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -227,7 +221,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -251,8 +245,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py index 0c7fe5569ed..4bb8a916a53 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/connectors.py @@ -47,7 +47,7 @@ def get( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, tunnel_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. @@ -74,8 +74,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -124,7 +122,7 @@ async def get( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, tunnel_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. @@ -151,8 +149,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py index 986e245d489..bc8900453d3 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/management.py @@ -49,7 +49,7 @@ def create( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, resources: List[Literal["logs"]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -122,7 +120,7 @@ async def create( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, resources: List[Literal["logs"]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -149,8 +147,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py index 895633244c9..34873e5c22c 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/cloudflared/token.py @@ -47,7 +47,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -71,8 +71,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -116,7 +114,7 @@ async def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -140,8 +138,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py index a1ce7d50af9..59474ccdf16 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/tunnels.py +++ b/src/cloudflare/resources/zero_trust/tunnels/tunnels.py @@ -73,7 +73,7 @@ def with_streaming_response(self) -> TunnelsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -128,8 +128,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -193,7 +191,7 @@ def with_streaming_response(self) -> AsyncTunnelsResourceWithStreamingResponse: def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -248,8 +246,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connections.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connections.py index 46040bb336d..11716e5ceac 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connections.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connections.py @@ -45,7 +45,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -69,8 +69,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -113,7 +111,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -137,8 +135,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connectors.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connectors.py index eb447d8d76d..27b2db82fd3 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connectors.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/connectors.py @@ -47,7 +47,7 @@ def get( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, tunnel_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. @@ -74,8 +74,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -124,7 +122,7 @@ async def get( self, connector_id: str, *, - account_id: str | None = None, + account_id: str, tunnel_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. @@ -151,8 +149,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/failover.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/failover.py index 71d83b7e81f..5aaf1805ce8 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/failover.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/failover.py @@ -47,7 +47,7 @@ def update( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, client_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. @@ -76,8 +76,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -122,7 +120,7 @@ async def update( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, client_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. @@ -151,8 +149,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py index e755560a2fc..1d5fb558c88 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/token.py @@ -47,7 +47,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -72,8 +72,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -117,7 +115,7 @@ async def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -142,8 +140,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py index e23f37359d5..7d70a1335c5 100644 --- a/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py +++ b/src/cloudflare/resources/zero_trust/tunnels/warp_connector/warp_connector.py @@ -106,7 +106,7 @@ def with_streaming_response(self) -> WARPConnectorResourceWithStreamingResponse: def create( self, *, - account_id: str | None = None, + account_id: str, name: str, ha: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -135,8 +135,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._post( @@ -161,7 +159,7 @@ def create( def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -213,8 +211,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -249,7 +245,7 @@ def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -273,8 +269,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -297,7 +291,7 @@ def edit( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, tunnel_secret: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -328,8 +322,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -359,7 +351,7 @@ def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -383,8 +375,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -443,7 +433,7 @@ def with_streaming_response(self) -> AsyncWARPConnectorResourceWithStreamingResp async def create( self, *, - account_id: str | None = None, + account_id: str, name: str, ha: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -472,8 +462,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return await self._post( @@ -498,7 +486,7 @@ async def create( def list( self, *, - account_id: str | None = None, + account_id: str, exclude_prefix: str | Omit = omit, existed_at: str | Omit = omit, include_prefix: str | Omit = omit, @@ -550,8 +538,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( @@ -586,7 +572,7 @@ async def delete( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -610,8 +596,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -634,7 +618,7 @@ async def edit( self, tunnel_id: str, *, - account_id: str | None = None, + account_id: str, name: str | Omit = omit, tunnel_secret: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -665,8 +649,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: @@ -696,7 +678,7 @@ async def get( self, tunnel_id: str, *, - account_id: str | None = None, + account_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, @@ -720,8 +702,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if account_id is None: - account_id = self._client._get_account_id_path_param() if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not tunnel_id: diff --git a/src/cloudflare/resources/zones/activation_check.py b/src/cloudflare/resources/zones/activation_check.py index ee28b04b0e3..2d8616583e0 100644 --- a/src/cloudflare/resources/zones/activation_check.py +++ b/src/cloudflare/resources/zones/activation_check.py @@ -46,7 +46,7 @@ def with_streaming_response(self) -> ActivationCheckResourceWithStreamingRespons def trigger( self, *, - zone_id: str | None = None, + 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, @@ -70,8 +70,6 @@ def trigger( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -110,7 +108,7 @@ def with_streaming_response(self) -> AsyncActivationCheckResourceWithStreamingRe async def trigger( self, *, - zone_id: str | None = None, + 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, @@ -134,8 +132,6 @@ async def trigger( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( diff --git a/src/cloudflare/resources/zones/custom_nameservers.py b/src/cloudflare/resources/zones/custom_nameservers.py index 2fe3e2743b5..20ed9f137a0 100644 --- a/src/cloudflare/resources/zones/custom_nameservers.py +++ b/src/cloudflare/resources/zones/custom_nameservers.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> CustomNameserversResourceWithStreamingRespo def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, ns_set: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,8 +86,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -113,7 +111,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -138,8 +136,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -177,7 +173,7 @@ def with_streaming_response(self) -> AsyncCustomNameserversResourceWithStreaming def update( self, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, ns_set: float | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -212,8 +208,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -239,7 +233,7 @@ def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -264,8 +258,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zones/environments.py b/src/cloudflare/resources/zones/environments.py index 47ca8b06133..c3b8ac1810e 100644 --- a/src/cloudflare/resources/zones/environments.py +++ b/src/cloudflare/resources/zones/environments.py @@ -52,7 +52,7 @@ def with_streaming_response(self) -> EnvironmentsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_create_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,8 +73,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -93,7 +91,7 @@ def create( def update( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_update_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -114,8 +112,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -134,7 +130,7 @@ def update( def list( self, *, - zone_id: str | None = None, + 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, @@ -154,8 +150,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -174,7 +168,7 @@ def delete( self, environment_id: str, *, - zone_id: str | None = None, + 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, @@ -194,8 +188,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not environment_id: @@ -217,7 +209,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_edit_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -238,8 +230,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -259,7 +249,7 @@ def rollback( self, environment_id: str, *, - zone_id: str | None = None, + 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, @@ -279,8 +269,6 @@ def rollback( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not environment_id: @@ -325,7 +313,7 @@ def with_streaming_response(self) -> AsyncEnvironmentsResourceWithStreamingRespo async def create( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_create_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -346,8 +334,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -368,7 +354,7 @@ async def create( async def update( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_update_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -389,8 +375,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -411,7 +395,7 @@ async def update( async def list( self, *, - zone_id: str | None = None, + 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, @@ -431,8 +415,6 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( @@ -451,7 +433,7 @@ async def delete( self, environment_id: str, *, - zone_id: str | None = None, + 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, @@ -471,8 +453,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not environment_id: @@ -494,7 +474,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, environments: Iterable[environment_edit_params.Environment], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -515,8 +495,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -538,7 +516,7 @@ async def rollback( self, environment_id: str, *, - zone_id: str | None = None, + 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, @@ -558,8 +536,6 @@ async def rollback( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not environment_id: diff --git a/src/cloudflare/resources/zones/holds.py b/src/cloudflare/resources/zones/holds.py index 74b25ab3843..c8074e3d9a9 100644 --- a/src/cloudflare/resources/zones/holds.py +++ b/src/cloudflare/resources/zones/holds.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> HoldsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, include_subdomains: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,8 +76,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -96,7 +94,7 @@ def create( def delete( self, *, - zone_id: str | None = None, + zone_id: str, hold_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -124,8 +122,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -144,7 +140,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, hold_after: str | Omit = omit, include_subdomains: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -180,8 +176,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -206,7 +200,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -229,8 +223,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -269,7 +261,7 @@ def with_streaming_response(self) -> AsyncHoldsResourceWithStreamingResponse: async def create( self, *, - zone_id: str | None = None, + zone_id: str, include_subdomains: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -298,8 +290,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -320,7 +310,7 @@ async def create( async def delete( self, *, - zone_id: str | None = None, + zone_id: str, hold_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -348,8 +338,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -368,7 +356,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, hold_after: str | Omit = omit, include_subdomains: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -404,8 +392,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -430,7 +416,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -453,8 +439,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zones/plans.py b/src/cloudflare/resources/zones/plans.py index 8803d47e872..50d2c64930f 100644 --- a/src/cloudflare/resources/zones/plans.py +++ b/src/cloudflare/resources/zones/plans.py @@ -47,7 +47,7 @@ def with_streaming_response(self) -> PlansResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + 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, @@ -69,8 +69,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -86,7 +84,7 @@ def get( self, plan_identifier: str, *, - zone_id: str | None = None, + 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, @@ -110,8 +108,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not plan_identifier: @@ -154,7 +150,7 @@ def with_streaming_response(self) -> AsyncPlansResourceWithStreamingResponse: def list( self, *, - zone_id: str | None = None, + 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, @@ -176,8 +172,6 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -193,7 +187,7 @@ async def get( self, plan_identifier: str, *, - zone_id: str | None = None, + 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, @@ -217,8 +211,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not plan_identifier: diff --git a/src/cloudflare/resources/zones/rate_plans.py b/src/cloudflare/resources/zones/rate_plans.py index a478f50d6ed..cf2f9933a23 100644 --- a/src/cloudflare/resources/zones/rate_plans.py +++ b/src/cloudflare/resources/zones/rate_plans.py @@ -44,7 +44,7 @@ def with_streaming_response(self) -> RatePlansResourceWithStreamingResponse: def get( self, *, - zone_id: str | None = None, + 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, @@ -66,8 +66,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( @@ -103,7 +101,7 @@ def with_streaming_response(self) -> AsyncRatePlansResourceWithStreamingResponse def get( self, *, - zone_id: str | None = None, + 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, @@ -125,8 +123,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() 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( diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py index 30c70858fc3..eb7abdf79cc 100644 --- a/src/cloudflare/resources/zones/settings.py +++ b/src/cloudflare/resources/zones/settings.py @@ -8,7 +8,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import path_template, maybe_transform, async_maybe_transform +from ..._utils import path_template, required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -51,7 +51,7 @@ def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -85,7 +85,7 @@ def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, value: setting_edit_params.Variant1Value | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -114,11 +114,12 @@ def edit( """ ... + @required_args(["zone_id"]) def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, value: setting_edit_params.Variant1Value | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -128,8 +129,6 @@ def edit( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -162,7 +161,7 @@ def get( self, setting_id: str, *, - zone_id: str | None = None, + 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, @@ -186,8 +185,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -235,7 +232,7 @@ async def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -269,7 +266,7 @@ async def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, value: setting_edit_params.Variant1Value | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -298,11 +295,12 @@ async def edit( """ ... + @required_args(["zone_id"]) async def edit( self, setting_id: str, *, - zone_id: str | None = None, + zone_id: str, enabled: bool | Omit = omit, value: setting_edit_params.Variant1Value | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -312,8 +310,6 @@ async def edit( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SettingEditResponse]: - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: @@ -346,7 +342,7 @@ async def get( self, setting_id: str, *, - zone_id: str | None = None, + 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, @@ -370,8 +366,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not setting_id: diff --git a/src/cloudflare/resources/zones/subscriptions.py b/src/cloudflare/resources/zones/subscriptions.py index dcb79a6de34..c5a387edf68 100644 --- a/src/cloudflare/resources/zones/subscriptions.py +++ b/src/cloudflare/resources/zones/subscriptions.py @@ -51,7 +51,7 @@ def with_streaming_response(self) -> SubscriptionsResourceWithStreamingResponse: def create( self, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +79,6 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._post( @@ -105,7 +103,7 @@ def create( def update( self, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -133,8 +131,6 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._put( @@ -159,7 +155,7 @@ def update( def get( self, *, - zone_id: str | None = None, + 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, @@ -181,8 +177,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -221,7 +215,7 @@ def with_streaming_response(self) -> AsyncSubscriptionsResourceWithStreamingResp async def create( self, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -249,8 +243,6 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._post( @@ -275,7 +267,7 @@ async def create( async def update( self, *, - zone_id: str | None = None, + zone_id: str, frequency: Literal["weekly", "monthly", "quarterly", "yearly"] | Omit = omit, rate_plan: RatePlan | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -303,8 +295,6 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._put( @@ -329,7 +319,7 @@ async def update( async def get( self, *, - zone_id: str | None = None, + 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, @@ -351,8 +341,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index 2ac3421c63c..290011057ee 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -282,7 +282,7 @@ def list( def delete( self, *, - zone_id: str | None = None, + 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, @@ -304,8 +304,6 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._delete( @@ -323,7 +321,7 @@ def delete( def edit( self, *, - zone_id: str | None = None, + zone_id: str, paused: bool | Omit = omit, type: Literal["full", "partial", "secondary", "internal"] | Omit = omit, vanity_name_servers: SequenceNotStr[str] | Omit = omit, @@ -360,8 +358,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._patch( @@ -387,7 +383,7 @@ def edit( def get( self, *, - zone_id: str | None = None, + 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, @@ -409,8 +405,6 @@ def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get( @@ -616,7 +610,7 @@ def list( async def delete( self, *, - zone_id: str | None = None, + 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, @@ -638,8 +632,6 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._delete( @@ -657,7 +649,7 @@ async def delete( async def edit( self, *, - zone_id: str | None = None, + zone_id: str, paused: bool | Omit = omit, type: Literal["full", "partial", "secondary", "internal"] | Omit = omit, vanity_name_servers: SequenceNotStr[str] | Omit = omit, @@ -694,8 +686,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._patch( @@ -721,7 +711,7 @@ async def edit( async def get( self, *, - zone_id: str | None = None, + 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, @@ -743,8 +733,6 @@ async def get( timeout: Override the client-level default timeout for this request, in seconds """ - if zone_id is None: - zone_id = self._client._get_zone_id_path_param() if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return await self._get( diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py index 6da2f0430a1..69e21aeea82 100644 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py @@ -20,7 +20,7 @@ class AbuseReportsDmcaReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_dmca"]] """The report type for submitted reports.""" @@ -142,7 +142,7 @@ class AbuseReportsDmcaReport(TypedDict, total=False): class AbuseReportsTrademarkReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_trademark"]] """The report type for submitted reports.""" @@ -228,7 +228,7 @@ class AbuseReportsTrademarkReport(TypedDict, total=False): class AbuseReportsGeneralReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_general"]] """The report type for submitted reports.""" @@ -327,7 +327,7 @@ class AbuseReportsGeneralReport(TypedDict, total=False): class AbuseReportsPhishingReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_phishing"]] """The report type for submitted reports.""" @@ -411,7 +411,7 @@ class AbuseReportsPhishingReport(TypedDict, total=False): class AbuseReportsCsamReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_children"]] """The report type for submitted reports.""" @@ -501,7 +501,7 @@ class AbuseReportsCsamReport(TypedDict, total=False): class AbuseReportsThreatReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_threat"]] """The report type for submitted reports.""" @@ -578,7 +578,7 @@ class AbuseReportsThreatReport(TypedDict, total=False): class AbuseReportsRegistrarWhoisReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_registrar_whois"]] """The report type for submitted reports.""" @@ -701,7 +701,7 @@ class AbuseReportsRegistrarWhoisReportRegWhoRequest(TypedDict, total=False): class AbuseReportsNcseiReport(TypedDict, total=False): - account_id: str + account_id: Required[str] act: Required[Literal["abuse_ncsei"]] """The report type for submitted reports.""" diff --git a/src/cloudflare/types/abuse_reports/abuse_report_list_params.py b/src/cloudflare/types/abuse_reports/abuse_report_list_params.py index 2079f7b70ef..94ececff967 100644 --- a/src/cloudflare/types/abuse_reports/abuse_report_list_params.py +++ b/src/cloudflare/types/abuse_reports/abuse_report_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AbuseReportListParams"] class AbuseReportListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] created_after: str """Returns reports created after the specified date""" diff --git a/src/cloudflare/types/abuse_reports/mitigation_list_params.py b/src/cloudflare/types/abuse_reports/mitigation_list_params.py index 9ec2264ce3a..4093a07c4fb 100644 --- a/src/cloudflare/types/abuse_reports/mitigation_list_params.py +++ b/src/cloudflare/types/abuse_reports/mitigation_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MitigationListParams"] class MitigationListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] effective_after: str """Returns mitigation that were dispatched after the given date""" diff --git a/src/cloudflare/types/abuse_reports/mitigation_review_params.py b/src/cloudflare/types/abuse_reports/mitigation_review_params.py index f9beba3f9ce..93cdff5c1ad 100644 --- a/src/cloudflare/types/abuse_reports/mitigation_review_params.py +++ b/src/cloudflare/types/abuse_reports/mitigation_review_params.py @@ -9,7 +9,7 @@ class MitigationReviewParams(TypedDict, total=False): - account_id: str + account_id: Required[str] appeals: Required[Iterable[Appeal]] """List of mitigations to appeal.""" diff --git a/src/cloudflare/types/accounts/account_update_params.py b/src/cloudflare/types/accounts/account_update_params.py index c9be1bd5274..d0cb3859d99 100644 --- a/src/cloudflare/types/accounts/account_update_params.py +++ b/src/cloudflare/types/accounts/account_update_params.py @@ -8,7 +8,7 @@ class AccountUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: Required[str] diff --git a/src/cloudflare/types/accounts/logs/audit_list_params.py b/src/cloudflare/types/accounts/logs/audit_list_params.py index 0e7c3af761d..39350b1f6b0 100644 --- a/src/cloudflare/types/accounts/logs/audit_list_params.py +++ b/src/cloudflare/types/accounts/logs/audit_list_params.py @@ -37,7 +37,7 @@ class AuditListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The unique id that identifies the account.""" before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] diff --git a/src/cloudflare/types/accounts/member_create_params.py b/src/cloudflare/types/accounts/member_create_params.py index 268f388074f..48c257c5826 100644 --- a/src/cloudflare/types/accounts/member_create_params.py +++ b/src/cloudflare/types/accounts/member_create_params.py @@ -18,7 +18,7 @@ class IAMCreateMemberWithRoles(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" email: Required[str] @@ -37,7 +37,7 @@ class IAMCreateMemberWithRoles(TypedDict, total=False): class IAMCreateMemberWithPolicies(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" email: Required[str] diff --git a/src/cloudflare/types/accounts/member_list_params.py b/src/cloudflare/types/accounts/member_list_params.py index 989647d59bd..cda9328b103 100644 --- a/src/cloudflare/types/accounts/member_list_params.py +++ b/src/cloudflare/types/accounts/member_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MemberListParams"] class MemberListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/accounts/member_update_params.py b/src/cloudflare/types/accounts/member_update_params.py index 0ef14ca6b20..6c0a304dce1 100644 --- a/src/cloudflare/types/accounts/member_update_params.py +++ b/src/cloudflare/types/accounts/member_update_params.py @@ -18,7 +18,7 @@ class IAMUpdateMemberWithRoles(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" roles: Iterable[Role] @@ -26,7 +26,7 @@ class IAMUpdateMemberWithRoles(TypedDict, total=False): class IAMUpdateMemberWithPolicies(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" policies: Required[Iterable[IAMUpdateMemberWithPoliciesPolicy]] diff --git a/src/cloudflare/types/accounts/role_list_params.py b/src/cloudflare/types/accounts/role_list_params.py index 5cd701000fd..d4e5289bbec 100644 --- a/src/cloudflare/types/accounts/role_list_params.py +++ b/src/cloudflare/types/accounts/role_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RoleListParams"] class RoleListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" page: float diff --git a/src/cloudflare/types/accounts/subscription_create_params.py b/src/cloudflare/types/accounts/subscription_create_params.py index fdf9a7d20de..8e1e503d9f6 100644 --- a/src/cloudflare/types/accounts/subscription_create_params.py +++ b/src/cloudflare/types/accounts/subscription_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..shared_params.rate_plan import RatePlan @@ -10,7 +10,7 @@ class SubscriptionCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" frequency: Literal["weekly", "monthly", "quarterly", "yearly"] diff --git a/src/cloudflare/types/accounts/subscription_update_params.py b/src/cloudflare/types/accounts/subscription_update_params.py index aefe3999115..fa42b5e2337 100644 --- a/src/cloudflare/types/accounts/subscription_update_params.py +++ b/src/cloudflare/types/accounts/subscription_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..shared_params.rate_plan import RatePlan @@ -10,7 +10,7 @@ class SubscriptionUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" frequency: Literal["weekly", "monthly", "quarterly", "yearly"] diff --git a/src/cloudflare/types/accounts/token_create_params.py b/src/cloudflare/types/accounts/token_create_params.py index a8d61bb29a4..6ff13271545 100644 --- a/src/cloudflare/types/accounts/token_create_params.py +++ b/src/cloudflare/types/accounts/token_create_params.py @@ -15,7 +15,7 @@ class TokenCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: Required[str] diff --git a/src/cloudflare/types/accounts/token_list_params.py b/src/cloudflare/types/accounts/token_list_params.py index 92ec000db2b..7a9ded98d9e 100644 --- a/src/cloudflare/types/accounts/token_list_params.py +++ b/src/cloudflare/types/accounts/token_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TokenListParams"] class TokenListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/accounts/token_update_params.py b/src/cloudflare/types/accounts/token_update_params.py index 28b5cd4a7b9..524886308b0 100644 --- a/src/cloudflare/types/accounts/token_update_params.py +++ b/src/cloudflare/types/accounts/token_update_params.py @@ -15,7 +15,7 @@ class TokenUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: Required[str] diff --git a/src/cloudflare/types/accounts/tokens/permission_group_get_params.py b/src/cloudflare/types/accounts/tokens/permission_group_get_params.py index aa19a3a33e5..c91ca4db066 100644 --- a/src/cloudflare/types/accounts/tokens/permission_group_get_params.py +++ b/src/cloudflare/types/accounts/tokens/permission_group_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PermissionGroupGetParams"] class PermissionGroupGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: str diff --git a/src/cloudflare/types/accounts/tokens/permission_group_list_params.py b/src/cloudflare/types/accounts/tokens/permission_group_list_params.py index 3bb553cb6b8..3a3000cb8a6 100644 --- a/src/cloudflare/types/accounts/tokens/permission_group_list_params.py +++ b/src/cloudflare/types/accounts/tokens/permission_group_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PermissionGroupListParams"] class PermissionGroupListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: str diff --git a/src/cloudflare/types/accounts/tokens/value_update_params.py b/src/cloudflare/types/accounts/tokens/value_update_params.py index 5fa0d36db1e..a70fab2ae59 100644 --- a/src/cloudflare/types/accounts/tokens/value_update_params.py +++ b/src/cloudflare/types/accounts/tokens/value_update_params.py @@ -8,7 +8,7 @@ class ValueUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" body: Required[object] diff --git a/src/cloudflare/types/acm/custom_trust_store_create_params.py b/src/cloudflare/types/acm/custom_trust_store_create_params.py index c715264411d..38498ed17fa 100644 --- a/src/cloudflare/types/acm/custom_trust_store_create_params.py +++ b/src/cloudflare/types/acm/custom_trust_store_create_params.py @@ -8,7 +8,7 @@ class CustomTrustStoreCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/acm/custom_trust_store_list_params.py b/src/cloudflare/types/acm/custom_trust_store_list_params.py index 4e069f99aa6..065c67d4223 100644 --- a/src/cloudflare/types/acm/custom_trust_store_list_params.py +++ b/src/cloudflare/types/acm/custom_trust_store_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CustomTrustStoreListParams"] class CustomTrustStoreListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" limit: int diff --git a/src/cloudflare/types/acm/total_tls_edit_params.py b/src/cloudflare/types/acm/total_tls_edit_params.py index c7089a514a2..defd75ebdd5 100644 --- a/src/cloudflare/types/acm/total_tls_edit_params.py +++ b/src/cloudflare/types/acm/total_tls_edit_params.py @@ -10,7 +10,7 @@ class TotalTLSEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: Required[bool] diff --git a/src/cloudflare/types/acm/total_tls_update_params.py b/src/cloudflare/types/acm/total_tls_update_params.py index 4c0d557071a..8a100d6e937 100644 --- a/src/cloudflare/types/acm/total_tls_update_params.py +++ b/src/cloudflare/types/acm/total_tls_update_params.py @@ -10,7 +10,7 @@ class TotalTLSUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: Required[bool] diff --git a/src/cloudflare/types/addressing/address_map_create_params.py b/src/cloudflare/types/addressing/address_map_create_params.py index 913a5083f87..7437032d536 100644 --- a/src/cloudflare/types/addressing/address_map_create_params.py +++ b/src/cloudflare/types/addressing/address_map_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .kind import Kind from ..._types import SequenceNotStr @@ -12,7 +12,7 @@ class AddressMapCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" description: Optional[str] diff --git a/src/cloudflare/types/addressing/address_map_edit_params.py b/src/cloudflare/types/addressing/address_map_edit_params.py index 71d12374080..78a94270693 100644 --- a/src/cloudflare/types/addressing/address_map_edit_params.py +++ b/src/cloudflare/types/addressing/address_map_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["AddressMapEditParams"] class AddressMapEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" default_sni: Optional[str] diff --git a/src/cloudflare/types/addressing/address_maps/account_update_params.py b/src/cloudflare/types/addressing/address_maps/account_update_params.py index f6653e3529d..ff618f7f917 100644 --- a/src/cloudflare/types/addressing/address_maps/account_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/account_update_params.py @@ -8,7 +8,7 @@ class AccountUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" body: Required[object] diff --git a/src/cloudflare/types/addressing/address_maps/ip_update_params.py b/src/cloudflare/types/addressing/address_maps/ip_update_params.py index 316a85b34a0..7c4e1611411 100644 --- a/src/cloudflare/types/addressing/address_maps/ip_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/ip_update_params.py @@ -8,7 +8,7 @@ class IPUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" address_map_id: Required[str] diff --git a/src/cloudflare/types/addressing/address_maps/zone_update_params.py b/src/cloudflare/types/addressing/address_maps/zone_update_params.py index 90092ef4ab9..04047f85fc0 100644 --- a/src/cloudflare/types/addressing/address_maps/zone_update_params.py +++ b/src/cloudflare/types/addressing/address_maps/zone_update_params.py @@ -8,10 +8,10 @@ class ZoneUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier of a zone.""" - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" body: Required[object] diff --git a/src/cloudflare/types/addressing/loa_document_create_params.py b/src/cloudflare/types/addressing/loa_document_create_params.py index 5abde543b68..3ea6bd6de69 100644 --- a/src/cloudflare/types/addressing/loa_document_create_params.py +++ b/src/cloudflare/types/addressing/loa_document_create_params.py @@ -8,7 +8,7 @@ class LOADocumentCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" loa_document: Required[str] diff --git a/src/cloudflare/types/addressing/prefix_create_params.py b/src/cloudflare/types/addressing/prefix_create_params.py index 5d936970e95..86828ed1d96 100644 --- a/src/cloudflare/types/addressing/prefix_create_params.py +++ b/src/cloudflare/types/addressing/prefix_create_params.py @@ -9,7 +9,7 @@ class PrefixCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" asn: Required[int] diff --git a/src/cloudflare/types/addressing/prefix_edit_params.py b/src/cloudflare/types/addressing/prefix_edit_params.py index 427aba530f6..b1ad60bb46f 100644 --- a/src/cloudflare/types/addressing/prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefix_edit_params.py @@ -8,7 +8,7 @@ class PrefixEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" description: Required[str] diff --git a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py index e4291a1824c..5de84a7f1d0 100644 --- a/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py +++ b/src/cloudflare/types/addressing/prefixes/advertisement_status_edit_params.py @@ -8,7 +8,7 @@ class AdvertisementStatusEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" advertised: Required[bool] diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py index ad51e52473a..dc9d548929e 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix_create_params.py @@ -8,7 +8,7 @@ class BGPPrefixCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" cidr: Required[str] diff --git a/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py b/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py index 6f30da96697..f610ee9434f 100644 --- a/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py +++ b/src/cloudflare/types/addressing/prefixes/bgp_prefix_edit_params.py @@ -8,7 +8,7 @@ class BGPPrefixEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" prefix_id: Required[str] diff --git a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py index 93e1d52a831..948fe969d3e 100644 --- a/src/cloudflare/types/addressing/prefixes/delegation_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/delegation_create_params.py @@ -8,7 +8,7 @@ class DelegationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" cidr: Required[str] diff --git a/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py b/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py index ed6fcf509f9..ed098c0dc4f 100644 --- a/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py +++ b/src/cloudflare/types/addressing/prefixes/service_binding_create_params.py @@ -8,7 +8,7 @@ class ServiceBindingCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of a Cloudflare account.""" cidr: Required[str] diff --git a/src/cloudflare/types/addressing/regional_hostname_create_params.py b/src/cloudflare/types/addressing/regional_hostname_create_params.py index 131b0475ba5..c462c98f63d 100644 --- a/src/cloudflare/types/addressing/regional_hostname_create_params.py +++ b/src/cloudflare/types/addressing/regional_hostname_create_params.py @@ -8,7 +8,7 @@ class RegionalHostnameCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hostname: Required[str] diff --git a/src/cloudflare/types/addressing/regional_hostname_edit_params.py b/src/cloudflare/types/addressing/regional_hostname_edit_params.py index 6da57bb9b05..822196cf6af 100644 --- a/src/cloudflare/types/addressing/regional_hostname_edit_params.py +++ b/src/cloudflare/types/addressing/regional_hostname_edit_params.py @@ -8,7 +8,7 @@ class RegionalHostnameEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" region_key: Required[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index 8bf93efc61c..d38ec3329b4 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -9,7 +9,7 @@ class AIGatewayCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """gateway id""" diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py index f7cdc20f0fe..a2545d4af8e 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["AIGatewayListParams"] class AIGatewayListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index 3fdbd032a2c..0843aea093a 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -20,7 +20,7 @@ class AIGatewayUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cache_invalidate_on_update: Required[bool] diff --git a/src/cloudflare/types/ai_gateway/dataset_create_params.py b/src/cloudflare/types/ai_gateway/dataset_create_params.py index 63e4e0cfe04..8c558e8d20b 100644 --- a/src/cloudflare/types/ai_gateway/dataset_create_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_create_params.py @@ -11,7 +11,7 @@ class DatasetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enable: Required[bool] diff --git a/src/cloudflare/types/ai_gateway/dataset_list_params.py b/src/cloudflare/types/ai_gateway/dataset_list_params.py index 4dd0124632e..440331fa032 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DatasetListParams"] class DatasetListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_update_params.py b/src/cloudflare/types/ai_gateway/dataset_update_params.py index 2c55d29699e..78abca5484d 100644 --- a/src/cloudflare/types/ai_gateway/dataset_update_params.py +++ b/src/cloudflare/types/ai_gateway/dataset_update_params.py @@ -11,7 +11,7 @@ class DatasetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] gateway_id: Required[str] """gateway id""" diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_params.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_params.py index efc1813565a..daf70ff0d0a 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_params.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_params.py @@ -8,7 +8,7 @@ class DynamicRoutingCreateDeploymentParams(TypedDict, total=False): - account_id: str + account_id: Required[str] gateway_id: Required[str] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_params.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_params.py index 8d8c537517f..135063ee111 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_params.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_params.py @@ -36,7 +36,7 @@ class DynamicRoutingCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] elements: Required[Iterable[Element]] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_params.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_params.py index ac281ff8a7a..d2a41a7298b 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_params.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_params.py @@ -36,7 +36,7 @@ class DynamicRoutingCreateVersionParams(TypedDict, total=False): - account_id: str + account_id: Required[str] gateway_id: Required[str] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_update_params.py b/src/cloudflare/types/ai_gateway/dynamic_routing_update_params.py index f0233f8fc52..75453811680 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_update_params.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_update_params.py @@ -8,7 +8,7 @@ class DynamicRoutingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] gateway_id: Required[str] diff --git a/src/cloudflare/types/ai_gateway/evaluation_create_params.py b/src/cloudflare/types/ai_gateway/evaluation_create_params.py index 5d22c2610e4..f434312dce7 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_create_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_create_params.py @@ -10,7 +10,7 @@ class EvaluationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] dataset_ids: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_params.py b/src/cloudflare/types/ai_gateway/evaluation_list_params.py index 5fe10f3a91d..deefec45cbf 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EvaluationListParams"] class EvaluationListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: str diff --git a/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py b/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py index 4a046a65622..5a03c32439c 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py +++ b/src/cloudflare/types/ai_gateway/evaluation_type_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["EvaluationTypeListParams"] class EvaluationTypeListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] order_by: str diff --git a/src/cloudflare/types/ai_gateway/log_delete_params.py b/src/cloudflare/types/ai_gateway/log_delete_params.py index 3b2159c033e..2aa8a530b71 100644 --- a/src/cloudflare/types/ai_gateway/log_delete_params.py +++ b/src/cloudflare/types/ai_gateway/log_delete_params.py @@ -11,7 +11,7 @@ class LogDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] filters: Iterable[Filter] diff --git a/src/cloudflare/types/ai_gateway/log_edit_params.py b/src/cloudflare/types/ai_gateway/log_edit_params.py index 32d19763ead..140b789b00c 100644 --- a/src/cloudflare/types/ai_gateway/log_edit_params.py +++ b/src/cloudflare/types/ai_gateway/log_edit_params.py @@ -9,7 +9,7 @@ class LogEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] gateway_id: Required[str] """gateway id""" diff --git a/src/cloudflare/types/ai_gateway/log_list_params.py b/src/cloudflare/types/ai_gateway/log_list_params.py index 6a59df4ea5f..b20feb3ae78 100644 --- a/src/cloudflare/types/ai_gateway/log_list_params.py +++ b/src/cloudflare/types/ai_gateway/log_list_params.py @@ -13,7 +13,7 @@ class LogListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cached: bool diff --git a/src/cloudflare/types/ai_gateway/provider_config_create_params.py b/src/cloudflare/types/ai_gateway/provider_config_create_params.py index 3f8eaa66547..fecfe448bcb 100644 --- a/src/cloudflare/types/ai_gateway/provider_config_create_params.py +++ b/src/cloudflare/types/ai_gateway/provider_config_create_params.py @@ -8,7 +8,7 @@ class ProviderConfigCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] alias: Required[str] diff --git a/src/cloudflare/types/ai_gateway/provider_config_list_params.py b/src/cloudflare/types/ai_gateway/provider_config_list_params.py index 6530539f80d..c1a36c2428a 100644 --- a/src/cloudflare/types/ai_gateway/provider_config_list_params.py +++ b/src/cloudflare/types/ai_gateway/provider_config_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ProviderConfigListParams"] class ProviderConfigListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 5ec107392b1..e3e758ab6ba 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -20,7 +20,7 @@ class InstanceChatCompletionsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] messages: Required[Iterable[Message]] diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index 0260d19406e..74f3cef2703 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -33,7 +33,7 @@ class InstanceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.""" diff --git a/src/cloudflare/types/aisearch/instance_list_params.py b/src/cloudflare/types/aisearch/instance_list_params.py index c69be488f9a..7c3b1faa18a 100644 --- a/src/cloudflare/types/aisearch/instance_list_params.py +++ b/src/cloudflare/types/aisearch/instance_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["InstanceListParams"] class InstanceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] namespace: Optional[str] diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index 1a6ce900868..b47c9fdc74d 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -20,7 +20,7 @@ class InstanceSearchParams(TypedDict, total=False): - account_id: str + account_id: Required[str] aisearch_options: Annotated[AISearchOptions, PropertyInfo(alias="ai_search_options")] diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index a483de8edbc..efdbcbdf308 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -33,7 +33,7 @@ class InstanceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] ai_gateway_id: Optional[str] diff --git a/src/cloudflare/types/aisearch/instances/job_create_params.py b/src/cloudflare/types/aisearch/instances/job_create_params.py index eee8bbcb449..243c20584fb 100644 --- a/src/cloudflare/types/aisearch/instances/job_create_params.py +++ b/src/cloudflare/types/aisearch/instances/job_create_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["JobCreateParams"] class JobCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: str diff --git a/src/cloudflare/types/aisearch/instances/job_list_params.py b/src/cloudflare/types/aisearch/instances/job_list_params.py index cab5a6501bf..41df366ab10 100644 --- a/src/cloudflare/types/aisearch/instances/job_list_params.py +++ b/src/cloudflare/types/aisearch/instances/job_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["JobListParams"] class JobListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int diff --git a/src/cloudflare/types/aisearch/instances/job_logs_params.py b/src/cloudflare/types/aisearch/instances/job_logs_params.py index aa9e0745699..3f573b3271e 100644 --- a/src/cloudflare/types/aisearch/instances/job_logs_params.py +++ b/src/cloudflare/types/aisearch/instances/job_logs_params.py @@ -8,7 +8,7 @@ class JobLogsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.""" diff --git a/src/cloudflare/types/aisearch/namespace_chat_completions_params.py b/src/cloudflare/types/aisearch/namespace_chat_completions_params.py index 8e1cd2535d4..e680b65bbe5 100644 --- a/src/cloudflare/types/aisearch/namespace_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/namespace_chat_completions_params.py @@ -21,7 +21,7 @@ class NamespaceChatCompletionsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] aisearch_options: Required[Annotated[AISearchOptions, PropertyInfo(alias="ai_search_options")]] diff --git a/src/cloudflare/types/aisearch/namespace_create_params.py b/src/cloudflare/types/aisearch/namespace_create_params.py index 64b5514f359..85cb7329f85 100644 --- a/src/cloudflare/types/aisearch/namespace_create_params.py +++ b/src/cloudflare/types/aisearch/namespace_create_params.py @@ -9,7 +9,7 @@ class NamespaceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespace_list_params.py b/src/cloudflare/types/aisearch/namespace_list_params.py index 5bc3091e667..264f0b98cc4 100644 --- a/src/cloudflare/types/aisearch/namespace_list_params.py +++ b/src/cloudflare/types/aisearch/namespace_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["NamespaceListParams"] class NamespaceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int """Page number (1-indexed).""" diff --git a/src/cloudflare/types/aisearch/namespace_search_params.py b/src/cloudflare/types/aisearch/namespace_search_params.py index 7f4b28df992..bb91b313077 100644 --- a/src/cloudflare/types/aisearch/namespace_search_params.py +++ b/src/cloudflare/types/aisearch/namespace_search_params.py @@ -21,7 +21,7 @@ class NamespaceSearchParams(TypedDict, total=False): - account_id: str + account_id: Required[str] aisearch_options: Required[Annotated[AISearchOptions, PropertyInfo(alias="ai_search_options")]] diff --git a/src/cloudflare/types/aisearch/namespace_update_params.py b/src/cloudflare/types/aisearch/namespace_update_params.py index 90384d81556..2249f2124fd 100644 --- a/src/cloudflare/types/aisearch/namespace_update_params.py +++ b/src/cloudflare/types/aisearch/namespace_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["NamespaceUpdateParams"] class NamespaceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: Optional[str] """Optional description for the namespace. Max 256 characters.""" diff --git a/src/cloudflare/types/aisearch/namespaces/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/namespaces/instance_chat_completions_params.py index fdef80ec2a5..b6ced3f9c8e 100644 --- a/src/cloudflare/types/aisearch/namespaces/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instance_chat_completions_params.py @@ -20,7 +20,7 @@ class InstanceChatCompletionsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instance_create_params.py b/src/cloudflare/types/aisearch/namespaces/instance_create_params.py index fee11c5c3d9..bf78a987478 100644 --- a/src/cloudflare/types/aisearch/namespaces/instance_create_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instance_create_params.py @@ -33,7 +33,7 @@ class InstanceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.""" diff --git a/src/cloudflare/types/aisearch/namespaces/instance_list_params.py b/src/cloudflare/types/aisearch/namespaces/instance_list_params.py index c69be488f9a..7c3b1faa18a 100644 --- a/src/cloudflare/types/aisearch/namespaces/instance_list_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instance_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["InstanceListParams"] class InstanceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] namespace: Optional[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instance_search_params.py b/src/cloudflare/types/aisearch/namespaces/instance_search_params.py index 3a8c7c4c112..57fca828e06 100644 --- a/src/cloudflare/types/aisearch/namespaces/instance_search_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instance_search_params.py @@ -20,7 +20,7 @@ class InstanceSearchParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instance_update_params.py b/src/cloudflare/types/aisearch/namespaces/instance_update_params.py index e2ac52fc3bb..cfd6dd5675c 100644 --- a/src/cloudflare/types/aisearch/namespaces/instance_update_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instance_update_params.py @@ -33,7 +33,7 @@ class InstanceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_chunks_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_chunks_params.py index 182e2d1350f..3275c830099 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_chunks_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_chunks_params.py @@ -8,7 +8,7 @@ class ItemChunksParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py index 595acb2b092..99ee3a5f635 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py @@ -8,7 +8,7 @@ class ItemCreateOrUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_list_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_list_params.py index 59091e3f9a6..4761dd0da83 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_list_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_list_params.py @@ -8,7 +8,7 @@ class ItemListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_logs_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_logs_params.py index 64478012b2e..3f4ac7414e7 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_logs_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_logs_params.py @@ -8,7 +8,7 @@ class ItemLogsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py index 2f6a96f0196..89a0585b224 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py @@ -8,7 +8,7 @@ class ItemSyncParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py index 71ee15f99a1..96dd49ad951 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py @@ -10,7 +10,7 @@ class ItemUploadParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/job_create_params.py b/src/cloudflare/types/aisearch/namespaces/instances/job_create_params.py index 3b661c9281b..b84f5b1e3ce 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/job_create_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/job_create_params.py @@ -8,7 +8,7 @@ class JobCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/job_list_params.py b/src/cloudflare/types/aisearch/namespaces/instances/job_list_params.py index a57c0e147f6..0b4154a1d55 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/job_list_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/job_list_params.py @@ -8,7 +8,7 @@ class JobListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/job_logs_params.py b/src/cloudflare/types/aisearch/namespaces/instances/job_logs_params.py index cb626d6d40b..cac6f72546e 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/job_logs_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/job_logs_params.py @@ -8,7 +8,7 @@ class JobLogsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/namespaces/instances/job_update_params.py b/src/cloudflare/types/aisearch/namespaces/instances/job_update_params.py index 1cd6b87f495..ebf1cea00cd 100644 --- a/src/cloudflare/types/aisearch/namespaces/instances/job_update_params.py +++ b/src/cloudflare/types/aisearch/namespaces/instances/job_update_params.py @@ -8,7 +8,7 @@ class JobUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/aisearch/token_create_params.py b/src/cloudflare/types/aisearch/token_create_params.py index 8373703deee..3b195f6ff20 100644 --- a/src/cloudflare/types/aisearch/token_create_params.py +++ b/src/cloudflare/types/aisearch/token_create_params.py @@ -8,7 +8,7 @@ class TokenCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cf_api_id: Required[str] diff --git a/src/cloudflare/types/aisearch/token_list_params.py b/src/cloudflare/types/aisearch/token_list_params.py index e98a767635b..4c7d4b9a296 100644 --- a/src/cloudflare/types/aisearch/token_list_params.py +++ b/src/cloudflare/types/aisearch/token_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TokenListParams"] class TokenListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int """Page number (1-indexed).""" diff --git a/src/cloudflare/types/aisearch/token_update_params.py b/src/cloudflare/types/aisearch/token_update_params.py index c2733902346..779d18117dc 100644 --- a/src/cloudflare/types/aisearch/token_update_params.py +++ b/src/cloudflare/types/aisearch/token_update_params.py @@ -8,7 +8,7 @@ class TokenUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cf_api_id: Required[str] diff --git a/src/cloudflare/types/alerting/destinations/webhook_create_params.py b/src/cloudflare/types/alerting/destinations/webhook_create_params.py index 4c5d1aeae95..9a14c7e35ca 100644 --- a/src/cloudflare/types/alerting/destinations/webhook_create_params.py +++ b/src/cloudflare/types/alerting/destinations/webhook_create_params.py @@ -8,7 +8,7 @@ class WebhookCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" name: Required[str] diff --git a/src/cloudflare/types/alerting/destinations/webhook_update_params.py b/src/cloudflare/types/alerting/destinations/webhook_update_params.py index 72d116ec2fb..d28b2ea9efe 100644 --- a/src/cloudflare/types/alerting/destinations/webhook_update_params.py +++ b/src/cloudflare/types/alerting/destinations/webhook_update_params.py @@ -8,7 +8,7 @@ class WebhookUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" name: Required[str] diff --git a/src/cloudflare/types/alerting/history_list_params.py b/src/cloudflare/types/alerting/history_list_params.py index 86ae2739009..913da1c6c6f 100644 --- a/src/cloudflare/types/alerting/history_list_params.py +++ b/src/cloudflare/types/alerting/history_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class HistoryListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" before: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/alerting/policy_create_params.py b/src/cloudflare/types/alerting/policy_create_params.py index f943d4c3843..fa5ed2838cf 100644 --- a/src/cloudflare/types/alerting/policy_create_params.py +++ b/src/cloudflare/types/alerting/policy_create_params.py @@ -11,7 +11,7 @@ class PolicyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" alert_type: Required[ diff --git a/src/cloudflare/types/alerting/policy_update_params.py b/src/cloudflare/types/alerting/policy_update_params.py index dd096305316..92df4ae3c39 100644 --- a/src/cloudflare/types/alerting/policy_update_params.py +++ b/src/cloudflare/types/alerting/policy_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .mechanism_param import MechanismParam from .policy_filter_param import PolicyFilterParam @@ -11,7 +11,7 @@ class PolicyUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" alert_interval: str diff --git a/src/cloudflare/types/alerting/silence_create_params.py b/src/cloudflare/types/alerting/silence_create_params.py index 854618e5cd0..d8d733bab17 100644 --- a/src/cloudflare/types/alerting/silence_create_params.py +++ b/src/cloudflare/types/alerting/silence_create_params.py @@ -9,7 +9,7 @@ class SilenceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/alerting/silence_update_params.py b/src/cloudflare/types/alerting/silence_update_params.py index 4ef82cc2633..59567cfd488 100644 --- a/src/cloudflare/types/alerting/silence_update_params.py +++ b/src/cloudflare/types/alerting/silence_update_params.py @@ -9,7 +9,7 @@ class SilenceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account id""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/api_gateway/configuration_get_params.py b/src/cloudflare/types/api_gateway/configuration_get_params.py index 44f5d98094e..c00dd74928d 100644 --- a/src/cloudflare/types/api_gateway/configuration_get_params.py +++ b/src/cloudflare/types/api_gateway/configuration_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ConfigurationGetParams"] class ConfigurationGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" normalize: bool diff --git a/src/cloudflare/types/api_gateway/configuration_update_params.py b/src/cloudflare/types/api_gateway/configuration_update_params.py index 472e997a860..f1d0aae61cc 100644 --- a/src/cloudflare/types/api_gateway/configuration_update_params.py +++ b/src/cloudflare/types/api_gateway/configuration_update_params.py @@ -14,7 +14,7 @@ class ConfigurationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" auth_id_characteristics: Required[Iterable[AuthIDCharacteristic]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py index 4e70d7eb3dc..c750d5f3eed 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_bulk_edit_params.py @@ -9,7 +9,7 @@ class OperationBulkEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Dict[str, Body]] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py index a3ef0ccbb02..8431ce868d8 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["OperationEditParams"] class OperationEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" state: Literal["review", "ignored"] diff --git a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py index f9c52a91006..9fa1389e662 100644 --- a/src/cloudflare/types/api_gateway/discovery/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/discovery/operation_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class OperationListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" diff: bool diff --git a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py index ecece881e0b..18508a7a0d9 100644 --- a/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py +++ b/src/cloudflare/types/api_gateway/expression_template/fallthrough_create_params.py @@ -10,7 +10,7 @@ class FallthroughCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hosts: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/api_gateway/label_list_params.py b/src/cloudflare/types/api_gateway/label_list_params.py index f5220a6d88b..b337bed3c58 100644 --- a/src/cloudflare/types/api_gateway/label_list_params.py +++ b/src/cloudflare/types/api_gateway/label_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["LabelListParams"] class LabelListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/api_gateway/labels/managed/resources/operation_update_params.py b/src/cloudflare/types/api_gateway/labels/managed/resources/operation_update_params.py index cdd3a5efdcb..9ac1c183791 100644 --- a/src/cloudflare/types/api_gateway/labels/managed/resources/operation_update_params.py +++ b/src/cloudflare/types/api_gateway/labels/managed/resources/operation_update_params.py @@ -10,7 +10,7 @@ class OperationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" selector: Required[Selector] diff --git a/src/cloudflare/types/api_gateway/labels/managed_get_params.py b/src/cloudflare/types/api_gateway/labels/managed_get_params.py index 83b7390605b..142f564d8da 100644 --- a/src/cloudflare/types/api_gateway/labels/managed_get_params.py +++ b/src/cloudflare/types/api_gateway/labels/managed_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ManagedGetParams"] class ManagedGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" with_mapped_resource_counts: bool diff --git a/src/cloudflare/types/api_gateway/labels/user/resources/operation_update_params.py b/src/cloudflare/types/api_gateway/labels/user/resources/operation_update_params.py index cdd3a5efdcb..9ac1c183791 100644 --- a/src/cloudflare/types/api_gateway/labels/user/resources/operation_update_params.py +++ b/src/cloudflare/types/api_gateway/labels/user/resources/operation_update_params.py @@ -10,7 +10,7 @@ class OperationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" selector: Required[Selector] diff --git a/src/cloudflare/types/api_gateway/labels/user_bulk_create_params.py b/src/cloudflare/types/api_gateway/labels/user_bulk_create_params.py index c9c9a2dc3df..49d825ddf5a 100644 --- a/src/cloudflare/types/api_gateway/labels/user_bulk_create_params.py +++ b/src/cloudflare/types/api_gateway/labels/user_bulk_create_params.py @@ -9,7 +9,7 @@ class UserBulkCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/api_gateway/labels/user_edit_params.py b/src/cloudflare/types/api_gateway/labels/user_edit_params.py index 150342216a2..d673bc20605 100644 --- a/src/cloudflare/types/api_gateway/labels/user_edit_params.py +++ b/src/cloudflare/types/api_gateway/labels/user_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserEditParams"] class UserEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" description: str diff --git a/src/cloudflare/types/api_gateway/labels/user_get_params.py b/src/cloudflare/types/api_gateway/labels/user_get_params.py index b3aa7a7d652..7dc41440ffa 100644 --- a/src/cloudflare/types/api_gateway/labels/user_get_params.py +++ b/src/cloudflare/types/api_gateway/labels/user_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserGetParams"] class UserGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" with_mapped_resource_counts: bool diff --git a/src/cloudflare/types/api_gateway/labels/user_update_params.py b/src/cloudflare/types/api_gateway/labels/user_update_params.py index 078b73f271e..b8b57259532 100644 --- a/src/cloudflare/types/api_gateway/labels/user_update_params.py +++ b/src/cloudflare/types/api_gateway/labels/user_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserUpdateParams"] class UserUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" description: str diff --git a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py index 56e8e0b8933..f5ef1ce8db1 100644 --- a/src/cloudflare/types/api_gateway/operation_bulk_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_bulk_create_params.py @@ -9,7 +9,7 @@ class OperationBulkCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/api_gateway/operation_create_params.py b/src/cloudflare/types/api_gateway/operation_create_params.py index bf63f2065de..f6eeb0677a1 100644 --- a/src/cloudflare/types/api_gateway/operation_create_params.py +++ b/src/cloudflare/types/api_gateway/operation_create_params.py @@ -8,7 +8,7 @@ class OperationCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" endpoint: Required[str] diff --git a/src/cloudflare/types/api_gateway/operation_get_params.py b/src/cloudflare/types/api_gateway/operation_get_params.py index 11e25466100..80b1e80e724 100644 --- a/src/cloudflare/types/api_gateway/operation_get_params.py +++ b/src/cloudflare/types/api_gateway/operation_get_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["OperationGetParams"] class OperationGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] diff --git a/src/cloudflare/types/api_gateway/operation_list_params.py b/src/cloudflare/types/api_gateway/operation_list_params.py index 4371540b40c..4ecdcf5db5e 100644 --- a/src/cloudflare/types/api_gateway/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/operation_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class OperationListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/api_gateway/operations/label_bulk_create_params.py b/src/cloudflare/types/api_gateway/operations/label_bulk_create_params.py index 38044fe7423..61bbc4f0297 100644 --- a/src/cloudflare/types/api_gateway/operations/label_bulk_create_params.py +++ b/src/cloudflare/types/api_gateway/operations/label_bulk_create_params.py @@ -10,7 +10,7 @@ class LabelBulkCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" selector: Required[Selector] diff --git a/src/cloudflare/types/api_gateway/operations/label_bulk_update_params.py b/src/cloudflare/types/api_gateway/operations/label_bulk_update_params.py index 9c1f8a13085..e4285241137 100644 --- a/src/cloudflare/types/api_gateway/operations/label_bulk_update_params.py +++ b/src/cloudflare/types/api_gateway/operations/label_bulk_update_params.py @@ -10,7 +10,7 @@ class LabelBulkUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" managed: Required[Managed] diff --git a/src/cloudflare/types/api_gateway/operations/label_create_params.py b/src/cloudflare/types/api_gateway/operations/label_create_params.py index 232aabb3f0e..686ce141486 100644 --- a/src/cloudflare/types/api_gateway/operations/label_create_params.py +++ b/src/cloudflare/types/api_gateway/operations/label_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class LabelCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" managed: SequenceNotStr[str] diff --git a/src/cloudflare/types/api_gateway/operations/label_update_params.py b/src/cloudflare/types/api_gateway/operations/label_update_params.py index bedd3d0c7bc..a50108369a7 100644 --- a/src/cloudflare/types/api_gateway/operations/label_update_params.py +++ b/src/cloudflare/types/api_gateway/operations/label_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class LabelUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" managed: SequenceNotStr[str] diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py index c1de924961d..ac49e74f27c 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_edit_params.py @@ -10,7 +10,7 @@ class SchemaValidationEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" settings_multiple_request: Required[SettingsMultipleRequestParam] diff --git a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py index 24045e2b141..ce1a0354046 100644 --- a/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/operations/schema_validation_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SchemaValidationUpdateParams"] class SchemaValidationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" mitigation_action: Optional[Literal["log", "block", "none"]] diff --git a/src/cloudflare/types/api_gateway/schema_list_params.py b/src/cloudflare/types/api_gateway/schema_list_params.py index 412ae025937..b80273584a1 100644 --- a/src/cloudflare/types/api_gateway/schema_list_params.py +++ b/src/cloudflare/types/api_gateway/schema_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class SchemaListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py index 441140f8754..16b93fa100e 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SchemaValidationEditParams"] class SchemaValidationEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_default_mitigation_action: Optional[Literal["none", "log", "block"]] diff --git a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py index 900abf9c95d..f77dd31637e 100644 --- a/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py +++ b/src/cloudflare/types/api_gateway/settings/schema_validation_update_params.py @@ -9,7 +9,7 @@ class SchemaValidationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_default_mitigation_action: Required[Literal["none", "log", "block"]] diff --git a/src/cloudflare/types/api_gateway/user_schema_create_params.py b/src/cloudflare/types/api_gateway/user_schema_create_params.py index 7fbbad14fd6..12dcf783e18 100644 --- a/src/cloudflare/types/api_gateway/user_schema_create_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_create_params.py @@ -10,7 +10,7 @@ class UserSchemaCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" file: Required[FileTypes] diff --git a/src/cloudflare/types/api_gateway/user_schema_edit_params.py b/src/cloudflare/types/api_gateway/user_schema_edit_params.py index 35348f35000..085ba5a2fbf 100644 --- a/src/cloudflare/types/api_gateway/user_schema_edit_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["UserSchemaEditParams"] class UserSchemaEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_enabled: Literal[True] diff --git a/src/cloudflare/types/api_gateway/user_schema_get_params.py b/src/cloudflare/types/api_gateway/user_schema_get_params.py index ff04f2df466..3fa24a59bce 100644 --- a/src/cloudflare/types/api_gateway/user_schema_get_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserSchemaGetParams"] class UserSchemaGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" omit_source: bool diff --git a/src/cloudflare/types/api_gateway/user_schema_list_params.py b/src/cloudflare/types/api_gateway/user_schema_list_params.py index 811922bb4ff..4cb1bdbbcca 100644 --- a/src/cloudflare/types/api_gateway/user_schema_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schema_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserSchemaListParams"] class UserSchemaListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" omit_source: bool diff --git a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py index f7106c44c4b..5865ee0d036 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/host_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostListParams"] class HostListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py index e93c03d6f32..25cd71a53c6 100644 --- a/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py +++ b/src/cloudflare/types/api_gateway/user_schemas/operation_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -11,7 +11,7 @@ class OperationListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" endpoint: str diff --git a/src/cloudflare/types/argo/smart_routing_edit_params.py b/src/cloudflare/types/argo/smart_routing_edit_params.py index 9f4b6ebd4b2..6a0817f9c6a 100644 --- a/src/cloudflare/types/argo/smart_routing_edit_params.py +++ b/src/cloudflare/types/argo/smart_routing_edit_params.py @@ -8,7 +8,7 @@ class SmartRoutingEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specifies the zone associated with the API call.""" value: Required[Literal["on", "off"]] diff --git a/src/cloudflare/types/argo/tiered_caching_edit_params.py b/src/cloudflare/types/argo/tiered_caching_edit_params.py index e4391bb57a3..1a1702873c2 100644 --- a/src/cloudflare/types/argo/tiered_caching_edit_params.py +++ b/src/cloudflare/types/argo/tiered_caching_edit_params.py @@ -8,7 +8,7 @@ class TieredCachingEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Literal["on", "off"]] diff --git a/src/cloudflare/types/audit_logs/audit_log_list_params.py b/src/cloudflare/types/audit_logs/audit_log_list_params.py index 195fb62b337..5b43966e45b 100644 --- a/src/cloudflare/types/audit_logs/audit_log_list_params.py +++ b/src/cloudflare/types/audit_logs/audit_log_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import date, datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class AuditLogListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" id: str diff --git a/src/cloudflare/types/billing/usage_paygo_params.py b/src/cloudflare/types/billing/usage_paygo_params.py index bafa06302bf..29409e92fd2 100644 --- a/src/cloudflare/types/billing/usage_paygo_params.py +++ b/src/cloudflare/types/billing/usage_paygo_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import date -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class UsagePaygoParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Represents a Cloudflare resource identifier tag.""" from_: Annotated[Union[str, date], PropertyInfo(alias="from", format="iso8601")] diff --git a/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py b/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py index 01b845aa89d..754653300df 100644 --- a/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py +++ b/src/cloudflare/types/bot_management/bot_fight_mode_configuration.py @@ -49,6 +49,13 @@ class BotFightModeConfiguration(BaseModel): cf_robots_variant: Optional[Literal["off", "policy_only"]] = None """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Optional[Literal["block", "disabled"]] = None + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/bot_fight_mode_configuration_param.py b/src/cloudflare/types/bot_management/bot_fight_mode_configuration_param.py index 64151a6bf71..adf3459108e 100644 --- a/src/cloudflare/types/bot_management/bot_fight_mode_configuration_param.py +++ b/src/cloudflare/types/bot_management/bot_fight_mode_configuration_param.py @@ -18,6 +18,13 @@ class BotFightModeConfigurationParam(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/bot_management_update_params.py b/src/cloudflare/types/bot_management/bot_management_update_params.py index 46a688eabad..f9f7fc22f2c 100644 --- a/src/cloudflare/types/bot_management/bot_management_update_params.py +++ b/src/cloudflare/types/bot_management/bot_management_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = [ "BotManagementUpdateParams", @@ -15,7 +15,7 @@ class BotFightModeConfiguration(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] @@ -28,6 +28,13 @@ class BotFightModeConfiguration(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -49,7 +56,7 @@ class BotFightModeConfiguration(TypedDict, total=False): class SuperBotFightModeDefinitelyConfiguration(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] @@ -62,6 +69,13 @@ class SuperBotFightModeDefinitelyConfiguration(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -96,7 +110,7 @@ class SuperBotFightModeDefinitelyConfiguration(TypedDict, total=False): class SuperBotFightModeLikelyConfiguration(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] @@ -109,6 +123,13 @@ class SuperBotFightModeLikelyConfiguration(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" @@ -146,7 +167,7 @@ class SuperBotFightModeLikelyConfiguration(TypedDict, total=False): class SubscriptionConfiguration(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" ai_bots_protection: Literal["block", "disabled", "only_on_ad_pages"] @@ -172,6 +193,13 @@ class SubscriptionConfiguration(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/subscription_configuration.py b/src/cloudflare/types/bot_management/subscription_configuration.py index fc306d5ddda..033e4ad6be6 100644 --- a/src/cloudflare/types/bot_management/subscription_configuration.py +++ b/src/cloudflare/types/bot_management/subscription_configuration.py @@ -62,6 +62,13 @@ class SubscriptionConfiguration(BaseModel): cf_robots_variant: Optional[Literal["off", "policy_only"]] = None """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Optional[Literal["block", "disabled"]] = None + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/subscription_configuration_param.py b/src/cloudflare/types/bot_management/subscription_configuration_param.py index 45ffd01599d..9e06cd07ff3 100644 --- a/src/cloudflare/types/bot_management/subscription_configuration_param.py +++ b/src/cloudflare/types/bot_management/subscription_configuration_param.py @@ -31,6 +31,13 @@ class SubscriptionConfigurationParam(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration.py b/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration.py index 4204c285ecc..c5b7263ce5f 100644 --- a/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration.py +++ b/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration.py @@ -34,6 +34,13 @@ class SuperBotFightModeDefinitelyConfiguration(BaseModel): cf_robots_variant: Optional[Literal["off", "policy_only"]] = None """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Optional[Literal["block", "disabled"]] = None + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration_param.py b/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration_param.py index 2ab93f1f5cf..91fac0c5949 100644 --- a/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration_param.py +++ b/src/cloudflare/types/bot_management/super_bot_fight_mode_definitely_configuration_param.py @@ -18,6 +18,13 @@ class SuperBotFightModeDefinitelyConfigurationParam(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration.py b/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration.py index 6368c98a654..7e94610cee0 100644 --- a/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration.py +++ b/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration.py @@ -28,6 +28,13 @@ class SuperBotFightModeLikelyConfiguration(BaseModel): cf_robots_variant: Optional[Literal["off", "policy_only"]] = None """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Optional[Literal["block", "disabled"]] = None + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Optional[Literal["enabled", "disabled"]] = None """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration_param.py b/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration_param.py index a219a368a2b..7253d26a93b 100644 --- a/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration_param.py +++ b/src/cloudflare/types/bot_management/super_bot_fight_mode_likely_configuration_param.py @@ -18,6 +18,13 @@ class SuperBotFightModeLikelyConfigurationParam(TypedDict, total=False): cf_robots_variant: Literal["off", "policy_only"] """Specifies the Robots Access Control License variant to use.""" + content_bots_protection: Literal["block", "disabled"] + """Enable rule to block content bots. + + When enabled, blocks automated traffic with low bot scores, excluding safe + verified bot categories. Exceptions should be managed via skip rules. + """ + crawler_protection: Literal["enabled", "disabled"] """Enable rule to punish AI Scrapers and Crawlers via a link maze.""" diff --git a/src/cloudflare/types/botnet_feed/asn_day_report_params.py b/src/cloudflare/types/botnet_feed/asn_day_report_params.py index c946f360b0f..516f4c6d977 100755 --- a/src/cloudflare/types/botnet_feed/asn_day_report_params.py +++ b/src/cloudflare/types/botnet_feed/asn_day_report_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class ASNDayReportParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/brand_protection/logo_create_params.py b/src/cloudflare/types/brand_protection/logo_create_params.py index 708aff0f04a..2fd40da7f6b 100644 --- a/src/cloudflare/types/brand_protection/logo_create_params.py +++ b/src/cloudflare/types/brand_protection/logo_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import FileTypes @@ -10,7 +10,7 @@ class LogoCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] match_type: str diff --git a/src/cloudflare/types/brand_protection/logo_match_download_params.py b/src/cloudflare/types/brand_protection/logo_match_download_params.py index ae3bb689b88..7d69d0c35a3 100644 --- a/src/cloudflare/types/brand_protection/logo_match_download_params.py +++ b/src/cloudflare/types/brand_protection/logo_match_download_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class LogoMatchDownloadParams(TypedDict, total=False): - account_id: str + account_id: Required[str] limit: str diff --git a/src/cloudflare/types/brand_protection/logo_match_get_params.py b/src/cloudflare/types/brand_protection/logo_match_get_params.py index 508069acb3d..19bc5dd4f9b 100644 --- a/src/cloudflare/types/brand_protection/logo_match_get_params.py +++ b/src/cloudflare/types/brand_protection/logo_match_get_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class LogoMatchGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] limit: str diff --git a/src/cloudflare/types/brand_protection/match_download_params.py b/src/cloudflare/types/brand_protection/match_download_params.py index 935ea8bf044..c9c1474e874 100644 --- a/src/cloudflare/types/brand_protection/match_download_params.py +++ b/src/cloudflare/types/brand_protection/match_download_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MatchDownloadParams"] class MatchDownloadParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str diff --git a/src/cloudflare/types/brand_protection/match_get_params.py b/src/cloudflare/types/brand_protection/match_get_params.py index a581f9f110d..e328903a3ec 100644 --- a/src/cloudflare/types/brand_protection/match_get_params.py +++ b/src/cloudflare/types/brand_protection/match_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MatchGetParams"] class MatchGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str diff --git a/src/cloudflare/types/brand_protection/query_bulk_params.py b/src/cloudflare/types/brand_protection/query_bulk_params.py index 9b80658d45e..6d03a6801e1 100644 --- a/src/cloudflare/types/brand_protection/query_bulk_params.py +++ b/src/cloudflare/types/brand_protection/query_bulk_params.py @@ -3,12 +3,12 @@ from __future__ import annotations from typing import Dict, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["QueryBulkParams"] class QueryBulkParams(TypedDict, total=False): - account_id: str + account_id: Required[str] queries: Iterable[Dict[str, object]] diff --git a/src/cloudflare/types/brand_protection/query_create_params.py b/src/cloudflare/types/brand_protection/query_create_params.py index f9dbc95be5b..543c7bbbc71 100644 --- a/src/cloudflare/types/brand_protection/query_create_params.py +++ b/src/cloudflare/types/brand_protection/query_create_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class QueryCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str diff --git a/src/cloudflare/types/brand_protection/query_delete_params.py b/src/cloudflare/types/brand_protection/query_delete_params.py index 3ae73979ca0..d4a095e924d 100644 --- a/src/cloudflare/types/brand_protection/query_delete_params.py +++ b/src/cloudflare/types/brand_protection/query_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["QueryDeleteParams"] class QueryDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str diff --git a/src/cloudflare/types/brand_protection/v2/logo_create_params.py b/src/cloudflare/types/brand_protection/v2/logo_create_params.py index 89aa53e2176..ad48572ac3c 100644 --- a/src/cloudflare/types/brand_protection/v2/logo_create_params.py +++ b/src/cloudflare/types/brand_protection/v2/logo_create_params.py @@ -8,7 +8,7 @@ class LogoCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] image_data: Required[str] """Base64 encoded image data. diff --git a/src/cloudflare/types/brand_protection/v2/logo_get_params.py b/src/cloudflare/types/brand_protection/v2/logo_get_params.py index ecfbb9d9243..dc4293d9ca2 100644 --- a/src/cloudflare/types/brand_protection/v2/logo_get_params.py +++ b/src/cloudflare/types/brand_protection/v2/logo_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LogoGetParams"] class LogoGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str """Optional query ID to retrieve a specific logo query""" diff --git a/src/cloudflare/types/brand_protection/v2/logo_match_get_params.py b/src/cloudflare/types/brand_protection/v2/logo_match_get_params.py index a076bf76ca5..458551d3c18 100644 --- a/src/cloudflare/types/brand_protection/v2/logo_match_get_params.py +++ b/src/cloudflare/types/brand_protection/v2/logo_match_get_params.py @@ -10,7 +10,7 @@ class LogoMatchGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] query_id: Required[str] diff --git a/src/cloudflare/types/brand_protection/v2/match_get_params.py b/src/cloudflare/types/brand_protection/v2/match_get_params.py index 1d4b394a83a..e1ea36eece0 100644 --- a/src/cloudflare/types/brand_protection/v2/match_get_params.py +++ b/src/cloudflare/types/brand_protection/v2/match_get_params.py @@ -11,13 +11,14 @@ class MatchGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] query_id: Required[SequenceNotStr[str]] """Query ID or comma-separated list of Query IDs. When multiple IDs are provided, matches are deduplicated across queries and each - match includes matched_queries and match_ids arrays. + match includes a match_details array with per-match query metadata and dismissed + state. """ domain_search: str diff --git a/src/cloudflare/types/brand_protection/v2/match_get_response.py b/src/cloudflare/types/brand_protection/v2/match_get_response.py index 92a21ab44b0..dec16b4c07e 100644 --- a/src/cloudflare/types/brand_protection/v2/match_get_response.py +++ b/src/cloudflare/types/brand_protection/v2/match_get_response.py @@ -4,16 +4,26 @@ from ...._models import BaseModel -__all__ = ["MatchGetResponse", "Match", "MatchPublicScans"] +__all__ = ["MatchGetResponse", "Match", "MatchPublicScans", "MatchMatchDetail"] class MatchPublicScans(BaseModel): submission_id: str -class Match(BaseModel): +class MatchMatchDetail(BaseModel): dismissed: bool + """Individual dismissed state for this specific match.""" + + match_id: int + + query_id: int + + query_tag: Optional[str] = None + """Tag associated with the query, if one exists.""" + +class Match(BaseModel): domain: str first_seen: str @@ -28,14 +38,15 @@ class Match(BaseModel): source: Optional[str] = None - match_ids: Optional[List[int]] = None - """All underlying match row IDs for this domain. + dismissed: Optional[bool] = None + """Whether the match is dismissed. - Only present when multiple query_ids are requested. + Only present for single-query requests. For multi-query requests, use the + dismissed field in each match_details entry. """ - matched_queries: Optional[List[int]] = None - """List of query IDs that produced this match. + match_details: Optional[List[MatchMatchDetail]] = None + """Per-match detail objects with query metadata and individual dismissed state. Only present when multiple query_ids are requested. """ diff --git a/src/cloudflare/types/brand_protection/v2/query_get_params.py b/src/cloudflare/types/brand_protection/v2/query_get_params.py index e3b1a764181..9393cb8fb5d 100644 --- a/src/cloudflare/types/brand_protection/v2/query_get_params.py +++ b/src/cloudflare/types/brand_protection/v2/query_get_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["QueryGetParams"] class QueryGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: str diff --git a/src/cloudflare/types/browser_rendering/content_create_params.py b/src/cloudflare/types/browser_rendering/content_create_params.py index 7926cdde58a..81af5dbbcc2 100644 --- a/src/cloudflare/types/browser_rendering/content_create_params.py +++ b/src/cloudflare/types/browser_rendering/content_create_params.py @@ -30,7 +30,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] @@ -262,7 +262,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] diff --git a/src/cloudflare/types/browser_rendering/crawl_create_params.py b/src/cloudflare/types/browser_rendering/crawl_create_params.py index 94fe0db30c6..938f0950b07 100644 --- a/src/cloudflare/types/browser_rendering/crawl_create_params.py +++ b/src/cloudflare/types/browser_rendering/crawl_create_params.py @@ -31,7 +31,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] @@ -380,7 +380,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" render: Required[Literal[False]] diff --git a/src/cloudflare/types/browser_rendering/crawl_get_params.py b/src/cloudflare/types/browser_rendering/crawl_get_params.py index 3d8e50e9026..eca4af2fddb 100644 --- a/src/cloudflare/types/browser_rendering/crawl_get_params.py +++ b/src/cloudflare/types/browser_rendering/crawl_get_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class CrawlGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" cache_ttl: Annotated[float, PropertyInfo(alias="cacheTTL")] diff --git a/src/cloudflare/types/browser_rendering/devtools/browser/target_create_params.py b/src/cloudflare/types/browser_rendering/devtools/browser/target_create_params.py index a082065dd38..7a0c744f9f1 100644 --- a/src/cloudflare/types/browser_rendering/devtools/browser/target_create_params.py +++ b/src/cloudflare/types/browser_rendering/devtools/browser/target_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TargetCreateParams"] class TargetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: str diff --git a/src/cloudflare/types/browser_rendering/devtools/browser_connect_params.py b/src/cloudflare/types/browser_rendering/devtools/browser_connect_params.py index 86c2233a81e..cbc89a6e0fd 100644 --- a/src/cloudflare/types/browser_rendering/devtools/browser_connect_params.py +++ b/src/cloudflare/types/browser_rendering/devtools/browser_connect_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["BrowserConnectParams"] class BrowserConnectParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" keep_alive: float diff --git a/src/cloudflare/types/browser_rendering/devtools/browser_create_params.py b/src/cloudflare/types/browser_rendering/devtools/browser_create_params.py index f5d5231f117..f46a724665c 100644 --- a/src/cloudflare/types/browser_rendering/devtools/browser_create_params.py +++ b/src/cloudflare/types/browser_rendering/devtools/browser_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["BrowserCreateParams"] class BrowserCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" keep_alive: float diff --git a/src/cloudflare/types/browser_rendering/devtools/browser_launch_params.py b/src/cloudflare/types/browser_rendering/devtools/browser_launch_params.py index 7722caee55f..c9016c7fad9 100644 --- a/src/cloudflare/types/browser_rendering/devtools/browser_launch_params.py +++ b/src/cloudflare/types/browser_rendering/devtools/browser_launch_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["BrowserLaunchParams"] class BrowserLaunchParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" keep_alive: float diff --git a/src/cloudflare/types/browser_rendering/devtools/session_list_params.py b/src/cloudflare/types/browser_rendering/devtools/session_list_params.py index 1b281efeab4..4a5795c6f28 100644 --- a/src/cloudflare/types/browser_rendering/devtools/session_list_params.py +++ b/src/cloudflare/types/browser_rendering/devtools/session_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SessionListParams"] class SessionListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" limit: float diff --git a/src/cloudflare/types/browser_rendering/json_create_params.py b/src/cloudflare/types/browser_rendering/json_create_params.py index 0054379925e..e2cbe43fe43 100644 --- a/src/cloudflare/types/browser_rendering/json_create_params.py +++ b/src/cloudflare/types/browser_rendering/json_create_params.py @@ -34,7 +34,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] @@ -305,7 +305,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/browser_rendering/link_create_params.py b/src/cloudflare/types/browser_rendering/link_create_params.py index 8c1baf9b55c..1b0794aa544 100644 --- a/src/cloudflare/types/browser_rendering/link_create_params.py +++ b/src/cloudflare/types/browser_rendering/link_create_params.py @@ -30,7 +30,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] @@ -269,7 +269,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/browser_rendering/markdown_create_params.py b/src/cloudflare/types/browser_rendering/markdown_create_params.py index d3fee07ee90..132af3610a9 100644 --- a/src/cloudflare/types/browser_rendering/markdown_create_params.py +++ b/src/cloudflare/types/browser_rendering/markdown_create_params.py @@ -30,7 +30,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] @@ -262,7 +262,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] diff --git a/src/cloudflare/types/browser_rendering/pdf_create_params.py b/src/cloudflare/types/browser_rendering/pdf_create_params.py index 205e5f547aa..7800a94fce7 100644 --- a/src/cloudflare/types/browser_rendering/pdf_create_params.py +++ b/src/cloudflare/types/browser_rendering/pdf_create_params.py @@ -34,7 +34,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] @@ -336,7 +336,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/browser_rendering/scrape_create_params.py b/src/cloudflare/types/browser_rendering/scrape_create_params.py index 2b493d2fa2c..118be807a0d 100644 --- a/src/cloudflare/types/browser_rendering/scrape_create_params.py +++ b/src/cloudflare/types/browser_rendering/scrape_create_params.py @@ -32,7 +32,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" elements: Required[Iterable[Variant0Element]] @@ -273,7 +273,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" elements: Required[Iterable[Variant1Element]] diff --git a/src/cloudflare/types/browser_rendering/screenshot_create_params.py b/src/cloudflare/types/browser_rendering/screenshot_create_params.py index 6a4b43a9ae7..b49d1a32a09 100644 --- a/src/cloudflare/types/browser_rendering/screenshot_create_params.py +++ b/src/cloudflare/types/browser_rendering/screenshot_create_params.py @@ -34,7 +34,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] @@ -310,7 +310,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/browser_rendering/snapshot_create_params.py b/src/cloudflare/types/browser_rendering/snapshot_create_params.py index c392ec2ac9a..f9d887a1a98 100644 --- a/src/cloudflare/types/browser_rendering/snapshot_create_params.py +++ b/src/cloudflare/types/browser_rendering/snapshot_create_params.py @@ -34,7 +34,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" html: Required[str] @@ -301,7 +301,7 @@ class Variant0WaitForSelector(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/cache/__init__.py b/src/cloudflare/types/cache/__init__.py index 10937a5c1b3..a8c1ab90c62 100644 --- a/src/cloudflare/types/cache/__init__.py +++ b/src/cloudflare/types/cache/__init__.py @@ -6,6 +6,7 @@ from .cache_reserve import CacheReserve as CacheReserve from .cache_purge_params import CachePurgeParams as CachePurgeParams from .cache_reserve_clear import CacheReserveClear as CacheReserveClear +from .origin_cloud_region import OriginCloudRegion as OriginCloudRegion from .variant_edit_params import VariantEditParams as VariantEditParams from .cache_purge_response import CachePurgeResponse as CachePurgeResponse from .variant_get_response import VariantGetResponse as VariantGetResponse @@ -19,9 +20,26 @@ from .cache_reserve_clear_response import CacheReserveClearResponse as CacheReserveClearResponse from .cache_reserve_status_response import CacheReserveStatusResponse as CacheReserveStatusResponse from .smart_tiered_cache_edit_params import SmartTieredCacheEditParams as SmartTieredCacheEditParams +from .origin_cloud_region_edit_params import OriginCloudRegionEditParams as OriginCloudRegionEditParams from .smart_tiered_cache_get_response import SmartTieredCacheGetResponse as SmartTieredCacheGetResponse +from .origin_cloud_region_get_response import OriginCloudRegionGetResponse as OriginCloudRegionGetResponse from .smart_tiered_cache_edit_response import SmartTieredCacheEditResponse as SmartTieredCacheEditResponse +from .origin_cloud_region_create_params import OriginCloudRegionCreateParams as OriginCloudRegionCreateParams +from .origin_cloud_region_edit_response import OriginCloudRegionEditResponse as OriginCloudRegionEditResponse +from .origin_cloud_region_list_response import OriginCloudRegionListResponse as OriginCloudRegionListResponse from .regional_tiered_cache_edit_params import RegionalTieredCacheEditParams as RegionalTieredCacheEditParams from .regional_tiered_cache_get_response import RegionalTieredCacheGetResponse as RegionalTieredCacheGetResponse from .smart_tiered_cache_delete_response import SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse +from .origin_cloud_region_create_response import OriginCloudRegionCreateResponse as OriginCloudRegionCreateResponse +from .origin_cloud_region_delete_response import OriginCloudRegionDeleteResponse as OriginCloudRegionDeleteResponse from .regional_tiered_cache_edit_response import RegionalTieredCacheEditResponse as RegionalTieredCacheEditResponse +from .origin_cloud_region_bulk_edit_params import OriginCloudRegionBulkEditParams as OriginCloudRegionBulkEditParams +from .origin_cloud_region_bulk_edit_response import ( + OriginCloudRegionBulkEditResponse as OriginCloudRegionBulkEditResponse, +) +from .origin_cloud_region_bulk_delete_response import ( + OriginCloudRegionBulkDeleteResponse as OriginCloudRegionBulkDeleteResponse, +) +from .origin_cloud_region_supported_regions_response import ( + OriginCloudRegionSupportedRegionsResponse as OriginCloudRegionSupportedRegionsResponse, +) diff --git a/src/cloudflare/types/cache/cache_purge_params.py b/src/cloudflare/types/cache/cache_purge_params.py index da77007894d..800757500ba 100644 --- a/src/cloudflare/types/cache/cache_purge_params.py +++ b/src/cloudflare/types/cache/cache_purge_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Union, Iterable -from typing_extensions import TypeAlias, TypedDict +from typing_extensions import Required, TypeAlias, TypedDict from ..._types import SequenceNotStr @@ -20,7 +20,7 @@ class CachePurgeFlexPurgeByTags(TypedDict, total=False): - zone_id: str + zone_id: Required[str] tags: SequenceNotStr[str] """ @@ -30,7 +30,7 @@ class CachePurgeFlexPurgeByTags(TypedDict, total=False): class CachePurgeFlexPurgeByHostnames(TypedDict, total=False): - zone_id: str + zone_id: Required[str] hosts: SequenceNotStr[str] """ @@ -40,7 +40,7 @@ class CachePurgeFlexPurgeByHostnames(TypedDict, total=False): class CachePurgeFlexPurgeByPrefixes(TypedDict, total=False): - zone_id: str + zone_id: Required[str] prefixes: SequenceNotStr[str] """ @@ -50,7 +50,7 @@ class CachePurgeFlexPurgeByPrefixes(TypedDict, total=False): class CachePurgeEverything(TypedDict, total=False): - zone_id: str + zone_id: Required[str] purge_everything: bool """ @@ -60,7 +60,7 @@ class CachePurgeEverything(TypedDict, total=False): class CachePurgeSingleFile(TypedDict, total=False): - zone_id: str + zone_id: Required[str] files: SequenceNotStr[str] """ @@ -70,7 +70,7 @@ class CachePurgeSingleFile(TypedDict, total=False): class CachePurgeSingleFileWithURLAndHeaders(TypedDict, total=False): - zone_id: str + zone_id: Required[str] files: Iterable[CachePurgeSingleFileWithURLAndHeadersFile] """ diff --git a/src/cloudflare/types/cache/cache_reserve_clear_params.py b/src/cloudflare/types/cache/cache_reserve_clear_params.py index 2d95edc9094..e549d5f3eca 100644 --- a/src/cloudflare/types/cache/cache_reserve_clear_params.py +++ b/src/cloudflare/types/cache/cache_reserve_clear_params.py @@ -8,7 +8,7 @@ class CacheReserveClearParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[object] diff --git a/src/cloudflare/types/cache/cache_reserve_edit_params.py b/src/cloudflare/types/cache/cache_reserve_edit_params.py index 9a69860a520..5565b6cf2e9 100644 --- a/src/cloudflare/types/cache/cache_reserve_edit_params.py +++ b/src/cloudflare/types/cache/cache_reserve_edit_params.py @@ -8,7 +8,7 @@ class CacheReserveEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Literal["on", "off"]] diff --git a/src/cloudflare/types/cache/origin_cloud_region.py b/src/cloudflare/types/cache/origin_cloud_region.py new file mode 100644 index 00000000000..54afe283353 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["OriginCloudRegion"] + + +class OriginCloudRegion(BaseModel): + """A single origin IP-to-cloud-region mapping.""" + + origin_ip: str = FieldInfo(alias="origin-ip") + """The origin IP address (IPv4 or IPv6, canonicalized).""" + + region: str + """Cloud vendor region identifier.""" + + vendor: Literal["aws", "azure", "gcp", "oci"] + """Cloud vendor hosting the origin.""" + + modified_on: Optional[datetime] = None + """Time this mapping was last modified.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_bulk_delete_response.py b/src/cloudflare/types/cache/origin_cloud_region_bulk_delete_response.py new file mode 100644 index 00000000000..d5ea3f1b7d1 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_bulk_delete_response.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["OriginCloudRegionBulkDeleteResponse", "Value", "ValueFailed", "ValueSucceeded"] + + +class ValueFailed(BaseModel): + """Result for a single item in a batch operation.""" + + origin_ip: str = FieldInfo(alias="origin-ip") + """The origin IP address for this item.""" + + error: Optional[str] = None + """Error message explaining why the item failed. Present only on failed items.""" + + region: Optional[str] = None + """Cloud vendor region identifier. + + Present on succeeded items for patch operations. + """ + + vendor: Optional[str] = None + """Cloud vendor identifier. Present on succeeded items for patch operations.""" + + +class ValueSucceeded(BaseModel): + """Result for a single item in a batch operation.""" + + origin_ip: str = FieldInfo(alias="origin-ip") + """The origin IP address for this item.""" + + error: Optional[str] = None + """Error message explaining why the item failed. Present only on failed items.""" + + region: Optional[str] = None + """Cloud vendor region identifier. + + Present on succeeded items for patch operations. + """ + + vendor: Optional[str] = None + """Cloud vendor identifier. Present on succeeded items for patch operations.""" + + +class Value(BaseModel): + failed: List[ValueFailed] + """Items that could not be applied, with error details.""" + + succeeded: List[ValueSucceeded] + """Items that were successfully applied.""" + + +class OriginCloudRegionBulkDeleteResponse(BaseModel): + """Response result for a batch origin cloud region operation.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: Value + + modified_on: Optional[datetime] = None + """Time the mapping set was last modified. + + Null when no items were successfully applied. + """ diff --git a/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_params.py b/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_params.py new file mode 100644 index 00000000000..c1edc6dc142 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_params.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["OriginCloudRegionBulkEditParams", "Body"] + + +class OriginCloudRegionBulkEditParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + body: Required[Iterable[Body]] + + +class Body(TypedDict, total=False): + """Request body for creating or updating an origin cloud region mapping.""" + + ip: Required[str] + """Origin IP address (IPv4 or IPv6). + + Normalized to canonical form before storage (RFC 5952 for IPv6). + """ + + region: Required[str] + """Cloud vendor region identifier. + + Must be a valid region for the specified vendor as returned by the + supported_regions endpoint. + """ + + vendor: Required[Literal["aws", "azure", "gcp", "oci"]] + """Cloud vendor hosting the origin. Must be one of the supported vendors.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_response.py b/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_response.py new file mode 100644 index 00000000000..097de32e532 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_bulk_edit_response.py @@ -0,0 +1,74 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["OriginCloudRegionBulkEditResponse", "Value", "ValueFailed", "ValueSucceeded"] + + +class ValueFailed(BaseModel): + """Result for a single item in a batch operation.""" + + origin_ip: str = FieldInfo(alias="origin-ip") + """The origin IP address for this item.""" + + error: Optional[str] = None + """Error message explaining why the item failed. Present only on failed items.""" + + region: Optional[str] = None + """Cloud vendor region identifier. + + Present on succeeded items for patch operations. + """ + + vendor: Optional[str] = None + """Cloud vendor identifier. Present on succeeded items for patch operations.""" + + +class ValueSucceeded(BaseModel): + """Result for a single item in a batch operation.""" + + origin_ip: str = FieldInfo(alias="origin-ip") + """The origin IP address for this item.""" + + error: Optional[str] = None + """Error message explaining why the item failed. Present only on failed items.""" + + region: Optional[str] = None + """Cloud vendor region identifier. + + Present on succeeded items for patch operations. + """ + + vendor: Optional[str] = None + """Cloud vendor identifier. Present on succeeded items for patch operations.""" + + +class Value(BaseModel): + failed: List[ValueFailed] + """Items that could not be applied, with error details.""" + + succeeded: List[ValueSucceeded] + """Items that were successfully applied.""" + + +class OriginCloudRegionBulkEditResponse(BaseModel): + """Response result for a batch origin cloud region operation.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: Value + + modified_on: Optional[datetime] = None + """Time the mapping set was last modified. + + Null when no items were successfully applied. + """ diff --git a/src/cloudflare/types/cache/origin_cloud_region_create_params.py b/src/cloudflare/types/cache/origin_cloud_region_create_params.py new file mode 100644 index 00000000000..001b5377dd7 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_create_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["OriginCloudRegionCreateParams"] + + +class OriginCloudRegionCreateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + ip: Required[str] + """Origin IP address (IPv4 or IPv6). + + Normalized to canonical form before storage (RFC 5952 for IPv6). + """ + + region: Required[str] + """Cloud vendor region identifier. + + Must be a valid region for the specified vendor as returned by the + supported_regions endpoint. + """ + + vendor: Required[Literal["aws", "azure", "gcp", "oci"]] + """Cloud vendor hosting the origin. Must be one of the supported vendors.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_create_response.py b/src/cloudflare/types/cache/origin_cloud_region_create_response.py new file mode 100644 index 00000000000..370d4051a68 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_create_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .origin_cloud_region import OriginCloudRegion + +__all__ = ["OriginCloudRegionCreateResponse"] + + +class OriginCloudRegionCreateResponse(BaseModel): + """Response result for a single origin cloud region mapping.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: OriginCloudRegion + """A single origin IP-to-cloud-region mapping.""" + + modified_on: Optional[datetime] = None + """Time the mapping was last modified.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_delete_response.py b/src/cloudflare/types/cache/origin_cloud_region_delete_response.py new file mode 100644 index 00000000000..fb8012e50c7 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_delete_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .origin_cloud_region import OriginCloudRegion + +__all__ = ["OriginCloudRegionDeleteResponse"] + + +class OriginCloudRegionDeleteResponse(BaseModel): + """Response result for a single origin cloud region mapping.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: OriginCloudRegion + """A single origin IP-to-cloud-region mapping.""" + + modified_on: Optional[datetime] = None + """Time the mapping was last modified.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_edit_params.py b/src/cloudflare/types/cache/origin_cloud_region_edit_params.py new file mode 100644 index 00000000000..270268f630a --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_edit_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["OriginCloudRegionEditParams"] + + +class OriginCloudRegionEditParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + ip: Required[str] + """Origin IP address (IPv4 or IPv6). + + Normalized to canonical form before storage (RFC 5952 for IPv6). + """ + + region: Required[str] + """Cloud vendor region identifier. + + Must be a valid region for the specified vendor as returned by the + supported_regions endpoint. + """ + + vendor: Required[Literal["aws", "azure", "gcp", "oci"]] + """Cloud vendor hosting the origin. Must be one of the supported vendors.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_edit_response.py b/src/cloudflare/types/cache/origin_cloud_region_edit_response.py new file mode 100644 index 00000000000..d84400575d2 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_edit_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .origin_cloud_region import OriginCloudRegion + +__all__ = ["OriginCloudRegionEditResponse"] + + +class OriginCloudRegionEditResponse(BaseModel): + """Response result for a list of origin cloud region mappings.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: List[OriginCloudRegion] + + modified_on: Optional[datetime] = None + """Time the mapping set was last modified. Null when no mappings exist.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_get_response.py b/src/cloudflare/types/cache/origin_cloud_region_get_response.py new file mode 100644 index 00000000000..1cb87ebebcf --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_get_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .origin_cloud_region import OriginCloudRegion + +__all__ = ["OriginCloudRegionGetResponse"] + + +class OriginCloudRegionGetResponse(BaseModel): + """Response result for a single origin cloud region mapping.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: OriginCloudRegion + """A single origin IP-to-cloud-region mapping.""" + + modified_on: Optional[datetime] = None + """Time the mapping was last modified.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_list_response.py b/src/cloudflare/types/cache/origin_cloud_region_list_response.py new file mode 100644 index 00000000000..fc9fcf49a68 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_list_response.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .origin_cloud_region import OriginCloudRegion + +__all__ = ["OriginCloudRegionListResponse"] + + +class OriginCloudRegionListResponse(BaseModel): + """Response result for a list of origin cloud region mappings.""" + + id: Literal["origin_public_cloud_region"] + + editable: bool + """Whether the setting can be modified by the current user.""" + + value: List[OriginCloudRegion] + + modified_on: Optional[datetime] = None + """Time the mapping set was last modified. Null when no mappings exist.""" diff --git a/src/cloudflare/types/cache/origin_cloud_region_supported_regions_response.py b/src/cloudflare/types/cache/origin_cloud_region_supported_regions_response.py new file mode 100644 index 00000000000..abd9b42d664 --- /dev/null +++ b/src/cloudflare/types/cache/origin_cloud_region_supported_regions_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from ..._models import BaseModel + +__all__ = ["OriginCloudRegionSupportedRegionsResponse", "Vendor"] + + +class Vendor(BaseModel): + """ + A single supported cloud region with associated Tiered Cache upper-tier colocations. + """ + + name: str + """Cloud vendor region identifier.""" + + upper_tier_colos: List[str] + """ + Cloudflare Tiered Cache upper-tier colocation codes co-located with this cloud + region. Requests from zones with a matching origin mapping will be routed + through these colos. + """ + + +class OriginCloudRegionSupportedRegionsResponse(BaseModel): + """Cloud vendors and their supported regions for origin cloud region mappings.""" + + obtained_codes: bool + """ + Whether Cloudflare airport codes (IATA colo identifiers) were successfully + resolved for the `upper_tier_colos` field on each region. When `false`, the + `upper_tier_colos` arrays may be empty or incomplete. + """ + + vendors: Dict[str, List[Vendor]] + """Map of vendor name to list of supported regions.""" diff --git a/src/cloudflare/types/cache/regional_tiered_cache_edit_params.py b/src/cloudflare/types/cache/regional_tiered_cache_edit_params.py index c24302ef9f8..f5d8b1ea299 100644 --- a/src/cloudflare/types/cache/regional_tiered_cache_edit_params.py +++ b/src/cloudflare/types/cache/regional_tiered_cache_edit_params.py @@ -8,7 +8,7 @@ class RegionalTieredCacheEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Literal["on", "off"]] diff --git a/src/cloudflare/types/cache/smart_tiered_cache_edit_params.py b/src/cloudflare/types/cache/smart_tiered_cache_edit_params.py index 8a1b9dfaf69..fccba724a30 100644 --- a/src/cloudflare/types/cache/smart_tiered_cache_edit_params.py +++ b/src/cloudflare/types/cache/smart_tiered_cache_edit_params.py @@ -8,7 +8,7 @@ class SmartTieredCacheEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Literal["on", "off"]] diff --git a/src/cloudflare/types/cache/variant_edit_params.py b/src/cloudflare/types/cache/variant_edit_params.py index 20e4a8e5325..d7b12d1a7a7 100644 --- a/src/cloudflare/types/cache/variant_edit_params.py +++ b/src/cloudflare/types/cache/variant_edit_params.py @@ -10,7 +10,7 @@ class VariantEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Value] diff --git a/src/cloudflare/types/calls/sfu_create_params.py b/src/cloudflare/types/calls/sfu_create_params.py index b9c0508b32e..701904d9621 100644 --- a/src/cloudflare/types/calls/sfu_create_params.py +++ b/src/cloudflare/types/calls/sfu_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SFUCreateParams"] class SFUCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: str diff --git a/src/cloudflare/types/calls/sfu_update_params.py b/src/cloudflare/types/calls/sfu_update_params.py index 29c26ae021d..a6c9750c222 100644 --- a/src/cloudflare/types/calls/sfu_update_params.py +++ b/src/cloudflare/types/calls/sfu_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SFUUpdateParams"] class SFUUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: str diff --git a/src/cloudflare/types/calls/turn_create_params.py b/src/cloudflare/types/calls/turn_create_params.py index 8c3b541b948..c81ae39b420 100644 --- a/src/cloudflare/types/calls/turn_create_params.py +++ b/src/cloudflare/types/calls/turn_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TURNCreateParams"] class TURNCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: str diff --git a/src/cloudflare/types/calls/turn_update_params.py b/src/cloudflare/types/calls/turn_update_params.py index 2e6ae6a76db..98e663a8388 100644 --- a/src/cloudflare/types/calls/turn_update_params.py +++ b/src/cloudflare/types/calls/turn_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TURNUpdateParams"] class TURNUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: str diff --git a/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py b/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py index 917f4db74c5..f0383af9e5f 100644 --- a/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py +++ b/src/cloudflare/types/certificate_authorities/hostname_association_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostnameAssociationGetParams"] class HostnameAssociationGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" mtls_certificate_id: str diff --git a/src/cloudflare/types/certificate_authorities/hostname_association_update_params.py b/src/cloudflare/types/certificate_authorities/hostname_association_update_params.py index 7bc8a445b96..b0c621712c6 100644 --- a/src/cloudflare/types/certificate_authorities/hostname_association_update_params.py +++ b/src/cloudflare/types/certificate_authorities/hostname_association_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr from .hostname_association import HostnameAssociation @@ -11,7 +11,7 @@ class HostnameAssociationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hostnames: SequenceNotStr[HostnameAssociation] diff --git a/src/cloudflare/types/client_certificates/client_certificate_create_params.py b/src/cloudflare/types/client_certificates/client_certificate_create_params.py index 50fec6feeea..b2c10107501 100644 --- a/src/cloudflare/types/client_certificates/client_certificate_create_params.py +++ b/src/cloudflare/types/client_certificates/client_certificate_create_params.py @@ -8,7 +8,7 @@ class ClientCertificateCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" csr: Required[str] diff --git a/src/cloudflare/types/client_certificates/client_certificate_edit_params.py b/src/cloudflare/types/client_certificates/client_certificate_edit_params.py index 8e853e80ee2..91c3632b733 100644 --- a/src/cloudflare/types/client_certificates/client_certificate_edit_params.py +++ b/src/cloudflare/types/client_certificates/client_certificate_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ClientCertificateEditParams"] class ClientCertificateEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" reactivate: bool diff --git a/src/cloudflare/types/client_certificates/client_certificate_list_params.py b/src/cloudflare/types/client_certificates/client_certificate_list_params.py index 572cf7549f2..10dc96904dc 100644 --- a/src/cloudflare/types/client_certificates/client_certificate_list_params.py +++ b/src/cloudflare/types/client_certificates/client_certificate_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ClientCertificateListParams"] class ClientCertificateListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" limit: int diff --git a/src/cloudflare/types/cloud_connector/rule_update_params.py b/src/cloudflare/types/cloud_connector/rule_update_params.py index eafafebd702..29a4207e16b 100644 --- a/src/cloudflare/types/cloud_connector/rule_update_params.py +++ b/src/cloudflare/types/cloud_connector/rule_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleUpdateParams", "Rule", "RuleParameters"] class RuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" rules: Iterable[Rule] diff --git a/src/cloudflare/types/cloudforce_one/binary_storage_create_params.py b/src/cloudflare/types/cloudforce_one/binary_storage_create_params.py index a0152eae6e6..ff8d1882de7 100644 --- a/src/cloudflare/types/cloudforce_one/binary_storage_create_params.py +++ b/src/cloudflare/types/cloudforce_one/binary_storage_create_params.py @@ -10,7 +10,7 @@ class BinaryStorageCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" file: Required[FileTypes] diff --git a/src/cloudflare/types/cloudforce_one/request_create_params.py b/src/cloudflare/types/cloudforce_one/request_create_params.py index de41b6dfe9f..e145b6b4e5f 100644 --- a/src/cloudflare/types/cloudforce_one/request_create_params.py +++ b/src/cloudflare/types/cloudforce_one/request_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RequestCreateParams"] class RequestCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" content: str diff --git a/src/cloudflare/types/cloudforce_one/request_list_params.py b/src/cloudflare/types/cloudforce_one/request_list_params.py index b017421c509..385f0dc0d77 100644 --- a/src/cloudflare/types/cloudforce_one/request_list_params.py +++ b/src/cloudflare/types/cloudforce_one/request_list_params.py @@ -12,7 +12,7 @@ class RequestListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: Required[int] diff --git a/src/cloudflare/types/cloudforce_one/request_update_params.py b/src/cloudflare/types/cloudforce_one/request_update_params.py index c17b7af762f..ac96d7fb0ca 100644 --- a/src/cloudflare/types/cloudforce_one/request_update_params.py +++ b/src/cloudflare/types/cloudforce_one/request_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RequestUpdateParams"] class RequestUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" content: str diff --git a/src/cloudflare/types/cloudforce_one/requests/asset_create_params.py b/src/cloudflare/types/cloudforce_one/requests/asset_create_params.py index 0c061155ff5..23f5455f55c 100644 --- a/src/cloudflare/types/cloudforce_one/requests/asset_create_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/asset_create_params.py @@ -8,7 +8,7 @@ class AssetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: Required[int] diff --git a/src/cloudflare/types/cloudforce_one/requests/asset_update_params.py b/src/cloudflare/types/cloudforce_one/requests/asset_update_params.py index 6e8177d942c..edde12c4a66 100644 --- a/src/cloudflare/types/cloudforce_one/requests/asset_update_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/asset_update_params.py @@ -8,7 +8,7 @@ class AssetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" request_id: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/requests/message_create_params.py b/src/cloudflare/types/cloudforce_one/requests/message_create_params.py index 8033107ce0c..eed1082151a 100644 --- a/src/cloudflare/types/cloudforce_one/requests/message_create_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/message_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MessageCreateParams"] class MessageCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" content: str diff --git a/src/cloudflare/types/cloudforce_one/requests/message_get_params.py b/src/cloudflare/types/cloudforce_one/requests/message_get_params.py index cbfd2ca6838..f8a73ef040c 100644 --- a/src/cloudflare/types/cloudforce_one/requests/message_get_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/message_get_params.py @@ -12,7 +12,7 @@ class MessageGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: Required[int] diff --git a/src/cloudflare/types/cloudforce_one/requests/message_update_params.py b/src/cloudflare/types/cloudforce_one/requests/message_update_params.py index e71c470d05e..c832ce22237 100644 --- a/src/cloudflare/types/cloudforce_one/requests/message_update_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/message_update_params.py @@ -8,7 +8,7 @@ class MessageUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" request_id: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py b/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py index e891d3ea8b5..58a30eaf6d7 100644 --- a/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/priority_create_params.py @@ -11,7 +11,7 @@ class PriorityCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" labels: Required[SequenceNotStr[Label]] diff --git a/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py b/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py index 7501b09431d..27a0b98135a 100644 --- a/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py +++ b/src/cloudflare/types/cloudforce_one/requests/priority_update_params.py @@ -11,7 +11,7 @@ class PriorityUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" labels: Required[SequenceNotStr[Label]] diff --git a/src/cloudflare/types/cloudforce_one/scans/config_create_params.py b/src/cloudflare/types/cloudforce_one/scans/config_create_params.py index 9e37cab73da..f974a52f24e 100644 --- a/src/cloudflare/types/cloudforce_one/scans/config_create_params.py +++ b/src/cloudflare/types/cloudforce_one/scans/config_create_params.py @@ -10,7 +10,7 @@ class ConfigCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Defines the Account ID.""" ips: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/cloudforce_one/scans/config_edit_params.py b/src/cloudflare/types/cloudforce_one/scans/config_edit_params.py index 21ab1f46707..57ced5e57e8 100644 --- a/src/cloudflare/types/cloudforce_one/scans/config_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/scans/config_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class ConfigEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Defines the Account ID.""" frequency: float diff --git a/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py b/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py index eae89e43b42..772769f2651 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_bulk_create_params.py @@ -13,7 +13,7 @@ class ThreatEventBulkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" data: Required[Iterable[Data]] diff --git a/src/cloudflare/types/cloudforce_one/threat_event_create_params.py b/src/cloudflare/types/cloudforce_one/threat_event_create_params.py index 5ceb622bd2e..8a06c593aee 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_create_params.py @@ -13,7 +13,7 @@ class ThreatEventCreateParams(TypedDict, total=False): - path_account_id: Annotated[str, PropertyInfo(alias="account_id")] + path_account_id: Required[Annotated[str, PropertyInfo(alias="account_id")]] """Account ID.""" category: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py index de1ad63adc9..7aed383f6f5 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_edit_params.py @@ -12,7 +12,7 @@ class ThreatEventEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" dataset_id: Required[Annotated[str, PropertyInfo(alias="datasetId")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_event_list_params.py b/src/cloudflare/types/cloudforce_one/threat_event_list_params.py index a5fbc858698..a8204dc0e89 100644 --- a/src/cloudflare/types/cloudforce_one/threat_event_list_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_event_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class ThreatEventListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" cursor: str @@ -25,6 +25,11 @@ class ThreatEventListParams(TypedDict, total=False): """ dataset_id: Annotated[SequenceNotStr[str], PropertyInfo(alias="datasetId")] + """ + Dataset IDs to query events from (array of UUIDs), or special value 'all' or + '\\**' to query all event datasets for the account. If not provided, uses the + default dataset. + """ force_refresh: Annotated[bool, PropertyInfo(alias="forceRefresh")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/attacker_list_params.py b/src/cloudflare/types/cloudforce_one/threat_events/attacker_list_params.py index 5d810b0f3f8..e0d50581e80 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/attacker_list_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/attacker_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class AttackerListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" dataset_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="datasetIds")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py index 5662b5cb70c..6c8699bb75c 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/category_create_params.py @@ -11,7 +11,7 @@ class CategoryCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" kill_chain: Required[Annotated[float, PropertyInfo(alias="killChain")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py index a62fc42c6e9..bdf4a4f3de4 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/category_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class CategoryEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" kill_chain: Annotated[float, PropertyInfo(alias="killChain")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/category_list_params.py b/src/cloudflare/types/cloudforce_one/threat_events/category_list_params.py index f88052373f2..fa43c1a4b41 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/category_list_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/category_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class CategoryListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" dataset_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="datasetIds")] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py index 81be710172b..dfeaa66e4c5 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/dataset_create_params.py @@ -10,7 +10,7 @@ class DatasetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" is_public: Required[Annotated[bool, PropertyInfo(alias="isPublic")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py index f2c5d8dfe5c..105e8e30834 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/dataset_edit_params.py @@ -10,7 +10,7 @@ class DatasetEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" is_public: Required[Annotated[bool, PropertyInfo(alias="isPublic")]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py index 1eb31d9c1f5..8a28221ab3e 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/event_tag_create_params.py @@ -10,7 +10,7 @@ class EventTagCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" tags: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py b/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py index 55594177450..c1a14dd1a1a 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/raw_edit_params.py @@ -8,7 +8,7 @@ class RawEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" event_id: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py b/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py index 996feef9203..85452744e19 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/tag_create_params.py @@ -11,7 +11,7 @@ class TagCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" value: Required[str] diff --git a/src/cloudflare/types/cloudforce_one/threat_events/target_industry_list_params.py b/src/cloudflare/types/cloudforce_one/threat_events/target_industry_list_params.py index 71ff9323b0b..2fde8d89e9a 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/target_industry_list_params.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/target_industry_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class TargetIndustryListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" dataset_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="datasetIds")] diff --git a/src/cloudflare/types/connectivity/directory/service_create_params.py b/src/cloudflare/types/connectivity/directory/service_create_params.py index 95569979c1e..ec11d783cc7 100644 --- a/src/cloudflare/types/connectivity/directory/service_create_params.py +++ b/src/cloudflare/types/connectivity/directory/service_create_params.py @@ -35,7 +35,7 @@ class InfraHTTPServiceConfig(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" host: Required[InfraHTTPServiceConfigHost] @@ -123,7 +123,7 @@ class InfraHTTPServiceConfigTLSSettings(TypedDict, total=False): class InfraTCPServiceConfig(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" host: Required[InfraTCPServiceConfigHost] diff --git a/src/cloudflare/types/connectivity/directory/service_list_params.py b/src/cloudflare/types/connectivity/directory/service_list_params.py index 46869aba6ec..1be439eda3f 100644 --- a/src/cloudflare/types/connectivity/directory/service_list_params.py +++ b/src/cloudflare/types/connectivity/directory/service_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ServiceListParams"] class ServiceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" page: int diff --git a/src/cloudflare/types/connectivity/directory/service_update_params.py b/src/cloudflare/types/connectivity/directory/service_update_params.py index 934b4abc380..b53bbdf393e 100644 --- a/src/cloudflare/types/connectivity/directory/service_update_params.py +++ b/src/cloudflare/types/connectivity/directory/service_update_params.py @@ -35,7 +35,7 @@ class InfraHTTPServiceConfig(TypedDict, total=False): - account_id: str + account_id: Required[str] host: Required[InfraHTTPServiceConfigHost] @@ -122,7 +122,7 @@ class InfraHTTPServiceConfigTLSSettings(TypedDict, total=False): class InfraTCPServiceConfig(TypedDict, total=False): - account_id: str + account_id: Required[str] host: Required[InfraTCPServiceConfigHost] diff --git a/src/cloudflare/types/content_scanning/content_scanning_create_params.py b/src/cloudflare/types/content_scanning/content_scanning_create_params.py index 29309f0bed2..ddfc7e607e4 100644 --- a/src/cloudflare/types/content_scanning/content_scanning_create_params.py +++ b/src/cloudflare/types/content_scanning/content_scanning_create_params.py @@ -8,7 +8,7 @@ class ContentScanningCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" value: Required[Literal["enabled", "disabled"]] diff --git a/src/cloudflare/types/content_scanning/content_scanning_update_params.py b/src/cloudflare/types/content_scanning/content_scanning_update_params.py index c228a9c9af7..4f50aaa3e87 100644 --- a/src/cloudflare/types/content_scanning/content_scanning_update_params.py +++ b/src/cloudflare/types/content_scanning/content_scanning_update_params.py @@ -8,7 +8,7 @@ class ContentScanningUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" value: Required[Literal["enabled", "disabled"]] diff --git a/src/cloudflare/types/content_scanning/payload_create_params.py b/src/cloudflare/types/content_scanning/payload_create_params.py index b3d41ef63fa..d4cc40f8d10 100644 --- a/src/cloudflare/types/content_scanning/payload_create_params.py +++ b/src/cloudflare/types/content_scanning/payload_create_params.py @@ -9,7 +9,7 @@ class PayloadCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py index 76c2615f3de..d63b4653aa7 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py @@ -11,7 +11,7 @@ class CustomCertificateCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py index 96101cb151c..c9bfbfc785e 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .geo_restrictions_param import GeoRestrictionsParam from ..custom_hostnames.bundle_method import BundleMethod @@ -11,7 +11,7 @@ class CustomCertificateEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" bundle_method: BundleMethod diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_list_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_list_params.py index 0059ab4c732..20c06cc0e2f 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_list_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CustomCertificateListParams"] class CustomCertificateListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" match: Literal["any", "all"] diff --git a/src/cloudflare/types/custom_certificates/prioritize_update_params.py b/src/cloudflare/types/custom_certificates/prioritize_update_params.py index 686b50e66d7..faae994d81c 100644 --- a/src/cloudflare/types/custom_certificates/prioritize_update_params.py +++ b/src/cloudflare/types/custom_certificates/prioritize_update_params.py @@ -9,7 +9,7 @@ class PrioritizeUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificates: Required[Iterable[Certificate]] diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py index aecae78b244..802bf9b20ac 100644 --- a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_params.py @@ -8,7 +8,7 @@ class CertificateUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" custom_hostname_id: Required[str] diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py index 37952d65974..7def1e47df9 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py @@ -15,7 +15,7 @@ class CustomHostnameCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hostname: Required[str] diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py index 46efb43f36b..9372bd89fa1 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py @@ -15,7 +15,7 @@ class CustomHostnameEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" custom_metadata: Dict[str, str] diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_list_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_list_params.py index 416f55637a7..d6dbca994e7 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_list_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CustomHostnameListParams", "Hostname"] class CustomHostnameListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" id: str diff --git a/src/cloudflare/types/custom_hostnames/fallback_origin_update_params.py b/src/cloudflare/types/custom_hostnames/fallback_origin_update_params.py index 3e4992b432d..d03e8bacde4 100644 --- a/src/cloudflare/types/custom_hostnames/fallback_origin_update_params.py +++ b/src/cloudflare/types/custom_hostnames/fallback_origin_update_params.py @@ -8,7 +8,7 @@ class FallbackOriginUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" origin: Required[str] diff --git a/src/cloudflare/types/custom_nameservers/custom_nameserver_create_params.py b/src/cloudflare/types/custom_nameservers/custom_nameserver_create_params.py index f5171543549..52dbcf63825 100644 --- a/src/cloudflare/types/custom_nameservers/custom_nameserver_create_params.py +++ b/src/cloudflare/types/custom_nameservers/custom_nameserver_create_params.py @@ -8,7 +8,7 @@ class CustomNameserverCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" ns_name: Required[str] diff --git a/src/cloudflare/types/d1/database/time_travel_get_bookmark_params.py b/src/cloudflare/types/d1/database/time_travel_get_bookmark_params.py index bb788f9e7f6..690290b6676 100644 --- a/src/cloudflare/types/d1/database/time_travel_get_bookmark_params.py +++ b/src/cloudflare/types/d1/database/time_travel_get_bookmark_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class TimeTravelGetBookmarkParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/d1/database/time_travel_restore_params.py b/src/cloudflare/types/d1/database/time_travel_restore_params.py index bbebd542a0b..ef86ba6d9ac 100644 --- a/src/cloudflare/types/d1/database/time_travel_restore_params.py +++ b/src/cloudflare/types/d1/database/time_travel_restore_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class TimeTravelRestoreParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" bookmark: str diff --git a/src/cloudflare/types/d1/database_create_params.py b/src/cloudflare/types/d1/database_create_params.py index 93d1d5fe0c4..54fc7485a7f 100644 --- a/src/cloudflare/types/d1/database_create_params.py +++ b/src/cloudflare/types/d1/database_create_params.py @@ -8,7 +8,7 @@ class DatabaseCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: Required[str] diff --git a/src/cloudflare/types/d1/database_edit_params.py b/src/cloudflare/types/d1/database_edit_params.py index 91457865c31..4dfec27b80e 100644 --- a/src/cloudflare/types/d1/database_edit_params.py +++ b/src/cloudflare/types/d1/database_edit_params.py @@ -8,7 +8,7 @@ class DatabaseEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" read_replication: ReadReplication diff --git a/src/cloudflare/types/d1/database_export_params.py b/src/cloudflare/types/d1/database_export_params.py index 9f63b8edb7e..cfe21f17154 100644 --- a/src/cloudflare/types/d1/database_export_params.py +++ b/src/cloudflare/types/d1/database_export_params.py @@ -10,7 +10,7 @@ class DatabaseExportParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" output_format: Required[Literal["polling"]] diff --git a/src/cloudflare/types/d1/database_import_params.py b/src/cloudflare/types/d1/database_import_params.py index 644dc0e7da1..63afb92175e 100644 --- a/src/cloudflare/types/d1/database_import_params.py +++ b/src/cloudflare/types/d1/database_import_params.py @@ -9,7 +9,7 @@ class Init(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" action: Required[Literal["init"]] @@ -24,7 +24,7 @@ class Init(TypedDict, total=False): class Ingest(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" action: Required[Literal["ingest"]] @@ -41,7 +41,7 @@ class Ingest(TypedDict, total=False): class Poll(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" action: Required[Literal["poll"]] diff --git a/src/cloudflare/types/d1/database_list_params.py b/src/cloudflare/types/d1/database_list_params.py index ddaee8b9fc9..a3fc5dc12e9 100644 --- a/src/cloudflare/types/d1/database_list_params.py +++ b/src/cloudflare/types/d1/database_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DatabaseListParams"] class DatabaseListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: str diff --git a/src/cloudflare/types/d1/database_query_params.py b/src/cloudflare/types/d1/database_query_params.py index 0e3a7dfb02f..afd658c44b2 100644 --- a/src/cloudflare/types/d1/database_query_params.py +++ b/src/cloudflare/types/d1/database_query_params.py @@ -11,7 +11,7 @@ class D1SingleQuery(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" sql: Required[str] @@ -25,7 +25,7 @@ class D1SingleQuery(TypedDict, total=False): class MultipleQueries(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" batch: Required[Iterable[MultipleQueriesBatch]] diff --git a/src/cloudflare/types/d1/database_raw_params.py b/src/cloudflare/types/d1/database_raw_params.py index af9cfb57a5d..ee9268e9649 100644 --- a/src/cloudflare/types/d1/database_raw_params.py +++ b/src/cloudflare/types/d1/database_raw_params.py @@ -11,7 +11,7 @@ class D1SingleQuery(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" sql: Required[str] @@ -25,7 +25,7 @@ class D1SingleQuery(TypedDict, total=False): class MultipleQueries(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" batch: Required[Iterable[MultipleQueriesBatch]] diff --git a/src/cloudflare/types/d1/database_update_params.py b/src/cloudflare/types/d1/database_update_params.py index 6759c940fa1..24355c484a5 100644 --- a/src/cloudflare/types/d1/database_update_params.py +++ b/src/cloudflare/types/d1/database_update_params.py @@ -8,7 +8,7 @@ class DatabaseUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" read_replication: Required[ReadReplication] diff --git a/src/cloudflare/types/diagnostics/endpoint_healthcheck_create_params.py b/src/cloudflare/types/diagnostics/endpoint_healthcheck_create_params.py index d7fd6bc3c2d..f47f969bac2 100644 --- a/src/cloudflare/types/diagnostics/endpoint_healthcheck_create_params.py +++ b/src/cloudflare/types/diagnostics/endpoint_healthcheck_create_params.py @@ -8,7 +8,7 @@ class EndpointHealthcheckCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" check_type: Required[Literal["icmp"]] diff --git a/src/cloudflare/types/diagnostics/endpoint_healthcheck_update_params.py b/src/cloudflare/types/diagnostics/endpoint_healthcheck_update_params.py index 28db1f47f90..85e0b0b7077 100644 --- a/src/cloudflare/types/diagnostics/endpoint_healthcheck_update_params.py +++ b/src/cloudflare/types/diagnostics/endpoint_healthcheck_update_params.py @@ -8,7 +8,7 @@ class EndpointHealthcheckUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" check_type: Required[Literal["icmp"]] diff --git a/src/cloudflare/types/diagnostics/traceroute_create_params.py b/src/cloudflare/types/diagnostics/traceroute_create_params.py index abcba8459c2..8e7419b2acc 100644 --- a/src/cloudflare/types/diagnostics/traceroute_create_params.py +++ b/src/cloudflare/types/diagnostics/traceroute_create_params.py @@ -10,7 +10,7 @@ class TracerouteCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" targets: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/dns_firewall/analytics/report_get_params.py b/src/cloudflare/types/dns_firewall/analytics/report_get_params.py index 5eca2d1b754..8ef5f5c9902 100644 --- a/src/cloudflare/types/dns_firewall/analytics/report_get_params.py +++ b/src/cloudflare/types/dns_firewall/analytics/report_get_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class ReportGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dimensions: str diff --git a/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py b/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py index 67cd6040c2f..e335fd562be 100644 --- a/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py +++ b/src/cloudflare/types/dns_firewall/analytics/reports/bytime_get_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ....._utils import PropertyInfo @@ -12,7 +12,7 @@ class BytimeGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dimensions: str diff --git a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py index 74268771db0..996bf478de0 100644 --- a/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py +++ b/src/cloudflare/types/dns_firewall/dns_firewall_create_params.py @@ -13,7 +13,7 @@ class DNSFirewallCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/dns_firewall/dns_firewall_edit_params.py b/src/cloudflare/types/dns_firewall/dns_firewall_edit_params.py index f1b4a351829..54db8800756 100644 --- a/src/cloudflare/types/dns_firewall/dns_firewall_edit_params.py +++ b/src/cloudflare/types/dns_firewall/dns_firewall_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr from .upstream_ips import UpstreamIPs @@ -13,7 +13,7 @@ class DNSFirewallEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" attack_mitigation: Optional[AttackMitigationParam] diff --git a/src/cloudflare/types/dns_firewall/dns_firewall_list_params.py b/src/cloudflare/types/dns_firewall/dns_firewall_list_params.py index 7df34f308a0..7be6cb9e4c5 100644 --- a/src/cloudflare/types/dns_firewall/dns_firewall_list_params.py +++ b/src/cloudflare/types/dns_firewall/dns_firewall_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DNSFirewallListParams"] class DNSFirewallListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: float diff --git a/src/cloudflare/types/dns_firewall/reverse_dns_edit_params.py b/src/cloudflare/types/dns_firewall/reverse_dns_edit_params.py index c6a853475d3..3dcee9d7c76 100644 --- a/src/cloudflare/types/dns_firewall/reverse_dns_edit_params.py +++ b/src/cloudflare/types/dns_firewall/reverse_dns_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ReverseDNSEditParams"] class ReverseDNSEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" ptr: Dict[str, str] diff --git a/src/cloudflare/types/durable_objects/namespace_list_params.py b/src/cloudflare/types/durable_objects/namespace_list_params.py index aa39c922733..fbcee077363 100644 --- a/src/cloudflare/types/durable_objects/namespace_list_params.py +++ b/src/cloudflare/types/durable_objects/namespace_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["NamespaceListParams"] class NamespaceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/durable_objects/namespaces/object_list_params.py b/src/cloudflare/types/durable_objects/namespaces/object_list_params.py index 252e27e8458..c9aed59a0d1 100644 --- a/src/cloudflare/types/durable_objects/namespaces/object_list_params.py +++ b/src/cloudflare/types/durable_objects/namespaces/object_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ObjectListParams"] class ObjectListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cursor: str diff --git a/src/cloudflare/types/email_routing/address_create_params.py b/src/cloudflare/types/email_routing/address_create_params.py index e4d64087f6d..fa5067b932d 100644 --- a/src/cloudflare/types/email_routing/address_create_params.py +++ b/src/cloudflare/types/email_routing/address_create_params.py @@ -8,7 +8,7 @@ class AddressCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" email: Required[str] diff --git a/src/cloudflare/types/email_routing/address_list_params.py b/src/cloudflare/types/email_routing/address_list_params.py index b13a4d2549f..8e345e2e994 100644 --- a/src/cloudflare/types/email_routing/address_list_params.py +++ b/src/cloudflare/types/email_routing/address_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AddressListParams"] class AddressListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/email_routing/dns_create_params.py b/src/cloudflare/types/email_routing/dns_create_params.py index ed934b84fb8..1d46da69429 100644 --- a/src/cloudflare/types/email_routing/dns_create_params.py +++ b/src/cloudflare/types/email_routing/dns_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DNSCreateParams"] class DNSCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" name: str diff --git a/src/cloudflare/types/email_routing/dns_edit_params.py b/src/cloudflare/types/email_routing/dns_edit_params.py index 2a0c20eb0db..67ec9ed80d9 100644 --- a/src/cloudflare/types/email_routing/dns_edit_params.py +++ b/src/cloudflare/types/email_routing/dns_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DNSEditParams"] class DNSEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" name: str diff --git a/src/cloudflare/types/email_routing/dns_get_params.py b/src/cloudflare/types/email_routing/dns_get_params.py index faba4bcc344..926b1619307 100644 --- a/src/cloudflare/types/email_routing/dns_get_params.py +++ b/src/cloudflare/types/email_routing/dns_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DNSGetParams"] class DNSGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" subdomain: str diff --git a/src/cloudflare/types/email_routing/email_routing_disable_params.py b/src/cloudflare/types/email_routing/email_routing_disable_params.py index a2f7b245760..94f4891ad9b 100644 --- a/src/cloudflare/types/email_routing/email_routing_disable_params.py +++ b/src/cloudflare/types/email_routing/email_routing_disable_params.py @@ -8,7 +8,7 @@ class EmailRoutingDisableParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[object] diff --git a/src/cloudflare/types/email_routing/email_routing_enable_params.py b/src/cloudflare/types/email_routing/email_routing_enable_params.py index 6289d4e5fa4..5feb5e016fa 100644 --- a/src/cloudflare/types/email_routing/email_routing_enable_params.py +++ b/src/cloudflare/types/email_routing/email_routing_enable_params.py @@ -8,7 +8,7 @@ class EmailRoutingEnableParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[object] diff --git a/src/cloudflare/types/email_routing/rule_create_params.py b/src/cloudflare/types/email_routing/rule_create_params.py index 2a96fdb1a31..9c99864160e 100644 --- a/src/cloudflare/types/email_routing/rule_create_params.py +++ b/src/cloudflare/types/email_routing/rule_create_params.py @@ -12,7 +12,7 @@ class RuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Required[Iterable[ActionParam]] diff --git a/src/cloudflare/types/email_routing/rule_list_params.py b/src/cloudflare/types/email_routing/rule_list_params.py index cdb5b69aa03..bb27b3d4885 100644 --- a/src/cloudflare/types/email_routing/rule_list_params.py +++ b/src/cloudflare/types/email_routing/rule_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleListParams"] class RuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: Literal[True, False] diff --git a/src/cloudflare/types/email_routing/rule_update_params.py b/src/cloudflare/types/email_routing/rule_update_params.py index 9712f7338fd..eaa7f60e258 100644 --- a/src/cloudflare/types/email_routing/rule_update_params.py +++ b/src/cloudflare/types/email_routing/rule_update_params.py @@ -12,7 +12,7 @@ class RuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Required[Iterable[ActionParam]] diff --git a/src/cloudflare/types/email_routing/rules/catch_all_update_params.py b/src/cloudflare/types/email_routing/rules/catch_all_update_params.py index e0afc3456cd..950fb1e1b36 100644 --- a/src/cloudflare/types/email_routing/rules/catch_all_update_params.py +++ b/src/cloudflare/types/email_routing/rules/catch_all_update_params.py @@ -12,7 +12,7 @@ class CatchAllUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Required[Iterable[CatchAllActionParam]] diff --git a/src/cloudflare/types/email_security/investigate/detection_get_response.py b/src/cloudflare/types/email_security/investigate/detection_get_response.py index 0897317cee2..444f1b45083 100644 --- a/src/cloudflare/types/email_security/investigate/detection_get_response.py +++ b/src/cloudflare/types/email_security/investigate/detection_get_response.py @@ -5,7 +5,16 @@ from ...._models import BaseModel -__all__ = ["DetectionGetResponse", "Attachment", "Header", "Link", "SenderInfo", "ThreatCategory", "Validation"] +__all__ = [ + "DetectionGetResponse", + "Attachment", + "Finding", + "Header", + "Link", + "SenderInfo", + "ThreatCategory", + "Validation", +] class Attachment(BaseModel): @@ -33,6 +42,39 @@ class Attachment(BaseModel): name: Optional[str] = None +class Finding(BaseModel): + attachment: Optional[str] = None + + detail: Optional[str] = None + + detection: Optional[ + Literal[ + "MALICIOUS", + "MALICIOUS-BEC", + "SUSPICIOUS", + "SPOOF", + "SPAM", + "BULK", + "ENCRYPTED", + "EXTERNAL", + "UNKNOWN", + "NONE", + ] + ] = None + + field: Optional[str] = None + + name: Optional[str] = None + + portion: Optional[str] = None + + reason: Optional[str] = None + + score: Optional[float] = None + + value: Optional[str] = None + + class Header(BaseModel): name: str @@ -82,6 +124,8 @@ class DetectionGetResponse(BaseModel): attachments: List[Attachment] + findings: List[Finding] + headers: List[Header] links: List[Link] diff --git a/src/cloudflare/types/email_security/investigate/move_bulk_params.py b/src/cloudflare/types/email_security/investigate/move_bulk_params.py index 95c5b5d2783..b269132b524 100644 --- a/src/cloudflare/types/email_security/investigate/move_bulk_params.py +++ b/src/cloudflare/types/email_security/investigate/move_bulk_params.py @@ -10,7 +10,7 @@ class MoveBulkParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" destination: Required[ diff --git a/src/cloudflare/types/email_security/investigate/move_create_params.py b/src/cloudflare/types/email_security/investigate/move_create_params.py index 87efbf79446..c4c977447e5 100644 --- a/src/cloudflare/types/email_security/investigate/move_create_params.py +++ b/src/cloudflare/types/email_security/investigate/move_create_params.py @@ -8,7 +8,7 @@ class MoveCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" destination: Required[ diff --git a/src/cloudflare/types/email_security/investigate/preview_create_params.py b/src/cloudflare/types/email_security/investigate/preview_create_params.py index af4a02f9e99..f14b41a6449 100644 --- a/src/cloudflare/types/email_security/investigate/preview_create_params.py +++ b/src/cloudflare/types/email_security/investigate/preview_create_params.py @@ -8,7 +8,7 @@ class PreviewCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" postfix_id: Required[str] diff --git a/src/cloudflare/types/email_security/investigate/reclassify_create_params.py b/src/cloudflare/types/email_security/investigate/reclassify_create_params.py index 5e27d769563..9bc5a664d51 100644 --- a/src/cloudflare/types/email_security/investigate/reclassify_create_params.py +++ b/src/cloudflare/types/email_security/investigate/reclassify_create_params.py @@ -8,7 +8,7 @@ class ReclassifyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" expected_disposition: Required[Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"]] diff --git a/src/cloudflare/types/email_security/investigate/release_bulk_params.py b/src/cloudflare/types/email_security/investigate/release_bulk_params.py index 42c984afdda..fa6f4ef65b3 100644 --- a/src/cloudflare/types/email_security/investigate/release_bulk_params.py +++ b/src/cloudflare/types/email_security/investigate/release_bulk_params.py @@ -10,7 +10,7 @@ class ReleaseBulkParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" body: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/email_security/investigate/trace_get_params.py b/src/cloudflare/types/email_security/investigate/trace_get_params.py index aaa0a513c3e..d4d5cf33670 100644 --- a/src/cloudflare/types/email_security/investigate/trace_get_params.py +++ b/src/cloudflare/types/email_security/investigate/trace_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TraceGetParams"] class TraceGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" submission: bool diff --git a/src/cloudflare/types/email_security/investigate_get_params.py b/src/cloudflare/types/email_security/investigate_get_params.py index e523a890dc2..083388f1cad 100644 --- a/src/cloudflare/types/email_security/investigate_get_params.py +++ b/src/cloudflare/types/email_security/investigate_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["InvestigateGetParams"] class InvestigateGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" submission: bool diff --git a/src/cloudflare/types/email_security/investigate_get_response.py b/src/cloudflare/types/email_security/investigate_get_response.py index eb1b7a11982..1396753de51 100644 --- a/src/cloudflare/types/email_security/investigate_get_response.py +++ b/src/cloudflare/types/email_security/investigate_get_response.py @@ -128,6 +128,10 @@ class InvestigateGetResponse(BaseModel): ] ] = None + delivery_status: Optional[ + List[Literal["delivered", "moved", "quarantined", "rejected", "deferred", "bounced", "queued"]] + ] = None + edf_hash: Optional[str] = None envelope_from: Optional[str] = None @@ -150,7 +154,7 @@ class InvestigateGetResponse(BaseModel): ] = None findings: Optional[List[Finding]] = None - """Deprecated.""" + """Deprecated: use `/investigate/{id}/detections` instead.""" from_: Optional[str] = FieldInfo(alias="from", default=None) diff --git a/src/cloudflare/types/email_security/investigate_list_params.py b/src/cloudflare/types/email_security/investigate_list_params.py index 960e2998fba..53d42d0d208 100644 --- a/src/cloudflare/types/email_security/investigate_list_params.py +++ b/src/cloudflare/types/email_security/investigate_list_params.py @@ -4,7 +4,7 @@ from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class InvestigateListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" action_log: bool @@ -51,7 +51,7 @@ class InvestigateListParams(TypedDict, total=False): """Deprecated: Use cursor pagination instead.""" per_page: int - """The number of results per page.""" + """The number of results per page. Maximum value is 1000.""" query: str """The space-delimited term used in the query. The search is case-insensitive. diff --git a/src/cloudflare/types/email_security/investigate_list_response.py b/src/cloudflare/types/email_security/investigate_list_response.py index f9c44c7b2fc..12c5ae7cb75 100644 --- a/src/cloudflare/types/email_security/investigate_list_response.py +++ b/src/cloudflare/types/email_security/investigate_list_response.py @@ -128,6 +128,10 @@ class InvestigateListResponse(BaseModel): ] ] = None + delivery_status: Optional[ + List[Literal["delivered", "moved", "quarantined", "rejected", "deferred", "bounced", "queued"]] + ] = None + edf_hash: Optional[str] = None envelope_from: Optional[str] = None @@ -150,7 +154,7 @@ class InvestigateListResponse(BaseModel): ] = None findings: Optional[List[Finding]] = None - """Deprecated.""" + """Deprecated: use `/investigate/{id}/detections` instead.""" from_: Optional[str] = FieldInfo(alias="from", default=None) diff --git a/src/cloudflare/types/email_security/phishguard/report_list_params.py b/src/cloudflare/types/email_security/phishguard/report_list_params.py index 3947050a3af..d138ab6e96c 100644 --- a/src/cloudflare/types/email_security/phishguard/report_list_params.py +++ b/src/cloudflare/types/email_security/phishguard/report_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import date, datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class ReportListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/email_security/settings/allow_policy_create_params.py b/src/cloudflare/types/email_security/settings/allow_policy_create_params.py index 8757340bfb4..9c0e132e1b2 100644 --- a/src/cloudflare/types/email_security/settings/allow_policy_create_params.py +++ b/src/cloudflare/types/email_security/settings/allow_policy_create_params.py @@ -9,7 +9,7 @@ class AllowPolicyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" is_acceptable_sender: Required[bool] diff --git a/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py b/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py index d26d1e6cc99..6b4de29a3bb 100644 --- a/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py +++ b/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AllowPolicyEditParams"] class AllowPolicyEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" comments: Optional[str] diff --git a/src/cloudflare/types/email_security/settings/allow_policy_list_params.py b/src/cloudflare/types/email_security/settings/allow_policy_list_params.py index 90c79372744..85380271064 100644 --- a/src/cloudflare/types/email_security/settings/allow_policy_list_params.py +++ b/src/cloudflare/types/email_security/settings/allow_policy_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AllowPolicyListParams"] class AllowPolicyListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_params.py b/src/cloudflare/types/email_security/settings/block_sender_create_params.py index afeaeba6cfc..dc5290d600f 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_create_params.py +++ b/src/cloudflare/types/email_security/settings/block_sender_create_params.py @@ -9,7 +9,7 @@ class BlockSenderCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" is_regex: Required[bool] diff --git a/src/cloudflare/types/email_security/settings/block_sender_edit_params.py b/src/cloudflare/types/email_security/settings/block_sender_edit_params.py index 716e8a2a1e5..19f2d23458a 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_edit_params.py +++ b/src/cloudflare/types/email_security/settings/block_sender_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["BlockSenderEditParams"] class BlockSenderEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" comments: Optional[str] diff --git a/src/cloudflare/types/email_security/settings/block_sender_list_params.py b/src/cloudflare/types/email_security/settings/block_sender_list_params.py index 56195b56848..712ad5932dd 100644 --- a/src/cloudflare/types/email_security/settings/block_sender_list_params.py +++ b/src/cloudflare/types/email_security/settings/block_sender_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["BlockSenderListParams"] class BlockSenderListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/email_security/settings/domain_edit_params.py b/src/cloudflare/types/email_security/settings/domain_edit_params.py index 167d443d595..bf6dec63309 100644 --- a/src/cloudflare/types/email_security/settings/domain_edit_params.py +++ b/src/cloudflare/types/email_security/settings/domain_edit_params.py @@ -11,7 +11,7 @@ class DomainEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" ip_restrictions: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/email_security/settings/domain_list_params.py b/src/cloudflare/types/email_security/settings/domain_list_params.py index 6c9a82aeeb0..6546a419a74 100644 --- a/src/cloudflare/types/email_security/settings/domain_list_params.py +++ b/src/cloudflare/types/email_security/settings/domain_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class DomainListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py index f9008beaf3e..db25db7e746 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py @@ -8,7 +8,7 @@ class ImpersonationRegistryCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" email: Required[str] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py index c62b6dd4707..8dceb0e75f7 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ImpersonationRegistryEditParams"] class ImpersonationRegistryEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" email: Optional[str] diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py index 26aa1ab4d4f..49a2b1ddf0a 100644 --- a/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py +++ b/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ImpersonationRegistryListParams"] class ImpersonationRegistryListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py index 2c0e719c06f..3159478e22d 100644 --- a/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py +++ b/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py @@ -9,7 +9,7 @@ class EmailSecurityCreateTrustedDomain(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" is_recent: Required[bool] @@ -32,7 +32,7 @@ class EmailSecurityCreateTrustedDomain(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" body: Required[Iterable[Variant1Body]] diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py index 07cf42555a5..90d1acfc7c0 100644 --- a/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py +++ b/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TrustedDomainEditParams"] class TrustedDomainEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" comments: str diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py index 28ca7c472dc..b9446971853 100644 --- a/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py +++ b/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TrustedDomainListParams"] class TrustedDomainListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/email_security/submission_list_params.py b/src/cloudflare/types/email_security/submission_list_params.py index c95f44da77d..225fb097290 100644 --- a/src/cloudflare/types/email_security/submission_list_params.py +++ b/src/cloudflare/types/email_security/submission_list_params.py @@ -4,7 +4,7 @@ from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class SubmissionListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" customer_status: Literal["escalated", "reviewed", "unreviewed"] diff --git a/src/cloudflare/types/email_sending/email_sending_send_params.py b/src/cloudflare/types/email_sending/email_sending_send_params.py index b994ba54b5d..ff540c47c02 100644 --- a/src/cloudflare/types/email_sending/email_sending_send_params.py +++ b/src/cloudflare/types/email_sending/email_sending_send_params.py @@ -21,7 +21,7 @@ class EmailSendingSendParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of the account.""" from_: Required[Annotated[From, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/email_sending/email_sending_send_raw_params.py b/src/cloudflare/types/email_sending/email_sending_send_raw_params.py index 296b6c85c56..41efcc174c7 100644 --- a/src/cloudflare/types/email_sending/email_sending_send_raw_params.py +++ b/src/cloudflare/types/email_sending/email_sending_send_raw_params.py @@ -11,7 +11,7 @@ class EmailSendingSendRawParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier of the account.""" from_: Required[Annotated[str, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/email_sending/subdomain_create_params.py b/src/cloudflare/types/email_sending/subdomain_create_params.py index 6eacd252670..75a009bf3e5 100644 --- a/src/cloudflare/types/email_sending/subdomain_create_params.py +++ b/src/cloudflare/types/email_sending/subdomain_create_params.py @@ -8,7 +8,7 @@ class SubdomainCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/filters/filter_bulk_delete_params.py b/src/cloudflare/types/filters/filter_bulk_delete_params.py index 3971271000f..7150780b6bd 100644 --- a/src/cloudflare/types/filters/filter_bulk_delete_params.py +++ b/src/cloudflare/types/filters/filter_bulk_delete_params.py @@ -10,7 +10,7 @@ class FilterBulkDeleteParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" id: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/filters/filter_bulk_update_params.py b/src/cloudflare/types/filters/filter_bulk_update_params.py index e8e846da6e4..23cc086a37b 100644 --- a/src/cloudflare/types/filters/filter_bulk_update_params.py +++ b/src/cloudflare/types/filters/filter_bulk_update_params.py @@ -9,7 +9,7 @@ class FilterBulkUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/filters/filter_create_params.py b/src/cloudflare/types/filters/filter_create_params.py index fad67e30f77..f21059d8cb8 100644 --- a/src/cloudflare/types/filters/filter_create_params.py +++ b/src/cloudflare/types/filters/filter_create_params.py @@ -11,7 +11,7 @@ class FilterCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" body: Required[Iterable[FirewallFilterParam]] diff --git a/src/cloudflare/types/filters/filter_list_params.py b/src/cloudflare/types/filters/filter_list_params.py index 90555b9820c..d64f470e5eb 100644 --- a/src/cloudflare/types/filters/filter_list_params.py +++ b/src/cloudflare/types/filters/filter_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["FilterListParams"] class FilterListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" id: str diff --git a/src/cloudflare/types/filters/filter_update_params.py b/src/cloudflare/types/filters/filter_update_params.py index ec439209dcf..38f6c3af411 100644 --- a/src/cloudflare/types/filters/filter_update_params.py +++ b/src/cloudflare/types/filters/filter_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["FilterUpdateParams"] class FilterUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" description: str diff --git a/src/cloudflare/types/firewall/lockdown_create_params.py b/src/cloudflare/types/firewall/lockdown_create_params.py index bfd96ed5c25..b25d78212dd 100644 --- a/src/cloudflare/types/firewall/lockdown_create_params.py +++ b/src/cloudflare/types/firewall/lockdown_create_params.py @@ -12,7 +12,7 @@ class LockdownCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" configurations: Required[ConfigurationParam] diff --git a/src/cloudflare/types/firewall/lockdown_list_params.py b/src/cloudflare/types/firewall/lockdown_list_params.py index 644942d6ec3..85b6a5cb4f0 100644 --- a/src/cloudflare/types/firewall/lockdown_list_params.py +++ b/src/cloudflare/types/firewall/lockdown_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class LockdownListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" created_on: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/firewall/lockdown_update_params.py b/src/cloudflare/types/firewall/lockdown_update_params.py index 5dda981da13..79c4db1b756 100644 --- a/src/cloudflare/types/firewall/lockdown_update_params.py +++ b/src/cloudflare/types/firewall/lockdown_update_params.py @@ -12,7 +12,7 @@ class LockdownUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" configurations: Required[ConfigurationParam] diff --git a/src/cloudflare/types/firewall/rule_bulk_edit_params.py b/src/cloudflare/types/firewall/rule_bulk_edit_params.py index 612cf917805..1ac14b38861 100644 --- a/src/cloudflare/types/firewall/rule_bulk_edit_params.py +++ b/src/cloudflare/types/firewall/rule_bulk_edit_params.py @@ -8,7 +8,7 @@ class RuleBulkEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" body: Required[object] diff --git a/src/cloudflare/types/firewall/rule_bulk_update_params.py b/src/cloudflare/types/firewall/rule_bulk_update_params.py index 241c96be1bb..2f5e7331b4c 100644 --- a/src/cloudflare/types/firewall/rule_bulk_update_params.py +++ b/src/cloudflare/types/firewall/rule_bulk_update_params.py @@ -8,7 +8,7 @@ class RuleBulkUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" body: Required[object] diff --git a/src/cloudflare/types/firewall/rule_create_params.py b/src/cloudflare/types/firewall/rule_create_params.py index be6cac35f57..a11900bed22 100644 --- a/src/cloudflare/types/firewall/rule_create_params.py +++ b/src/cloudflare/types/firewall/rule_create_params.py @@ -10,7 +10,7 @@ class RuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" action: Required[Action] diff --git a/src/cloudflare/types/firewall/rule_list_params.py b/src/cloudflare/types/firewall/rule_list_params.py index 9fc0d6d002e..8cfb84bcb12 100644 --- a/src/cloudflare/types/firewall/rule_list_params.py +++ b/src/cloudflare/types/firewall/rule_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RuleListParams"] class RuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" id: str diff --git a/src/cloudflare/types/firewall/rule_update_params.py b/src/cloudflare/types/firewall/rule_update_params.py index 8259ab50fde..cde6e776dd3 100644 --- a/src/cloudflare/types/firewall/rule_update_params.py +++ b/src/cloudflare/types/firewall/rule_update_params.py @@ -10,7 +10,7 @@ class RuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" action: Required[Action] diff --git a/src/cloudflare/types/firewall/ua_rule_create_params.py b/src/cloudflare/types/firewall/ua_rule_create_params.py index 41f451f14c3..01e49728041 100644 --- a/src/cloudflare/types/firewall/ua_rule_create_params.py +++ b/src/cloudflare/types/firewall/ua_rule_create_params.py @@ -8,7 +8,7 @@ class UARuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" configuration: Required[Configuration] diff --git a/src/cloudflare/types/firewall/ua_rule_list_params.py b/src/cloudflare/types/firewall/ua_rule_list_params.py index 658a7d9b9b8..c40c8bd6cde 100644 --- a/src/cloudflare/types/firewall/ua_rule_list_params.py +++ b/src/cloudflare/types/firewall/ua_rule_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UARuleListParams"] class UARuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" description: str diff --git a/src/cloudflare/types/firewall/ua_rule_update_params.py b/src/cloudflare/types/firewall/ua_rule_update_params.py index c79606c34eb..eb27661492d 100644 --- a/src/cloudflare/types/firewall/ua_rule_update_params.py +++ b/src/cloudflare/types/firewall/ua_rule_update_params.py @@ -15,7 +15,7 @@ class UARuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" configuration: Required[Configuration] diff --git a/src/cloudflare/types/firewall/waf/override_create_params.py b/src/cloudflare/types/firewall/waf/override_create_params.py index f61dc086967..d280db03748 100644 --- a/src/cloudflare/types/firewall/waf/override_create_params.py +++ b/src/cloudflare/types/firewall/waf/override_create_params.py @@ -11,7 +11,7 @@ class OverrideCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" urls: Required[SequenceNotStr[OverrideURL]] diff --git a/src/cloudflare/types/firewall/waf/override_list_params.py b/src/cloudflare/types/firewall/waf/override_list_params.py index ce5f5154cb4..12d8111435e 100644 --- a/src/cloudflare/types/firewall/waf/override_list_params.py +++ b/src/cloudflare/types/firewall/waf/override_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["OverrideListParams"] class OverrideListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" page: float diff --git a/src/cloudflare/types/firewall/waf/override_update_params.py b/src/cloudflare/types/firewall/waf/override_update_params.py index 5a033f16a7b..2c138cbd98a 100644 --- a/src/cloudflare/types/firewall/waf/override_update_params.py +++ b/src/cloudflare/types/firewall/waf/override_update_params.py @@ -13,7 +13,7 @@ class OverrideUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" id: Required[str] diff --git a/src/cloudflare/types/firewall/waf/package_list_params.py b/src/cloudflare/types/firewall/waf/package_list_params.py index fb8d67ed714..364d1f35f07 100644 --- a/src/cloudflare/types/firewall/waf/package_list_params.py +++ b/src/cloudflare/types/firewall/waf/package_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PackageListParams"] class PackageListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/firewall/waf/packages/group_edit_params.py b/src/cloudflare/types/firewall/waf/packages/group_edit_params.py index 9cb33853236..2134f85a1e0 100644 --- a/src/cloudflare/types/firewall/waf/packages/group_edit_params.py +++ b/src/cloudflare/types/firewall/waf/packages/group_edit_params.py @@ -8,7 +8,7 @@ class GroupEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier of a schema.""" package_id: Required[str] diff --git a/src/cloudflare/types/firewall/waf/packages/group_list_params.py b/src/cloudflare/types/firewall/waf/packages/group_list_params.py index 6ce99c88034..d7e0dea3b06 100644 --- a/src/cloudflare/types/firewall/waf/packages/group_list_params.py +++ b/src/cloudflare/types/firewall/waf/packages/group_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["GroupListParams"] class GroupListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier of a schema.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/firewall/waf/packages/rule_edit_params.py b/src/cloudflare/types/firewall/waf/packages/rule_edit_params.py index 2c6396b114c..b9a3c69b7a2 100644 --- a/src/cloudflare/types/firewall/waf/packages/rule_edit_params.py +++ b/src/cloudflare/types/firewall/waf/packages/rule_edit_params.py @@ -8,7 +8,7 @@ class RuleEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier of a schema.""" package_id: Required[str] diff --git a/src/cloudflare/types/firewall/waf/packages/rule_list_params.py b/src/cloudflare/types/firewall/waf/packages/rule_list_params.py index 43df7a129bd..0288be1e0fa 100644 --- a/src/cloudflare/types/firewall/waf/packages/rule_list_params.py +++ b/src/cloudflare/types/firewall/waf/packages/rule_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RuleListParams"] class RuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier of a schema.""" description: str diff --git a/src/cloudflare/types/fraud/fraud_update_params.py b/src/cloudflare/types/fraud/fraud_update_params.py index ecb14d675be..78d59357e8c 100644 --- a/src/cloudflare/types/fraud/fraud_update_params.py +++ b/src/cloudflare/types/fraud/fraud_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class FraudUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" user_profiles: Literal["enabled", "disabled"] diff --git a/src/cloudflare/types/google_tag_gateway/config_update_params.py b/src/cloudflare/types/google_tag_gateway/config_update_params.py index 747ac98abbd..0fb64062ed9 100644 --- a/src/cloudflare/types/google_tag_gateway/config_update_params.py +++ b/src/cloudflare/types/google_tag_gateway/config_update_params.py @@ -11,7 +11,7 @@ class ConfigUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: Required[bool] diff --git a/src/cloudflare/types/healthchecks/healthcheck_create_params.py b/src/cloudflare/types/healthchecks/healthcheck_create_params.py index 5340b2e1c3e..90a2b01f73f 100644 --- a/src/cloudflare/types/healthchecks/healthcheck_create_params.py +++ b/src/cloudflare/types/healthchecks/healthcheck_create_params.py @@ -14,7 +14,7 @@ class HealthcheckCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" address: Required[str] diff --git a/src/cloudflare/types/healthchecks/healthcheck_edit_params.py b/src/cloudflare/types/healthchecks/healthcheck_edit_params.py index a9a3fc2d3b6..605ca984c32 100644 --- a/src/cloudflare/types/healthchecks/healthcheck_edit_params.py +++ b/src/cloudflare/types/healthchecks/healthcheck_edit_params.py @@ -14,7 +14,7 @@ class HealthcheckEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" address: Required[str] diff --git a/src/cloudflare/types/healthchecks/healthcheck_list_params.py b/src/cloudflare/types/healthchecks/healthcheck_list_params.py index a99bd2b8407..919be7432fb 100644 --- a/src/cloudflare/types/healthchecks/healthcheck_list_params.py +++ b/src/cloudflare/types/healthchecks/healthcheck_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HealthcheckListParams"] class HealthcheckListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" page: float diff --git a/src/cloudflare/types/healthchecks/healthcheck_update_params.py b/src/cloudflare/types/healthchecks/healthcheck_update_params.py index b8dce39ac02..834571fde52 100644 --- a/src/cloudflare/types/healthchecks/healthcheck_update_params.py +++ b/src/cloudflare/types/healthchecks/healthcheck_update_params.py @@ -14,7 +14,7 @@ class HealthcheckUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" address: Required[str] diff --git a/src/cloudflare/types/healthchecks/preview_create_params.py b/src/cloudflare/types/healthchecks/preview_create_params.py index 41b14b58cce..8020a44e035 100644 --- a/src/cloudflare/types/healthchecks/preview_create_params.py +++ b/src/cloudflare/types/healthchecks/preview_create_params.py @@ -14,7 +14,7 @@ class PreviewCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" address: Required[str] diff --git a/src/cloudflare/types/hostnames/settings/tls_update_params.py b/src/cloudflare/types/hostnames/settings/tls_update_params.py index a111d434eac..90e8a461362 100644 --- a/src/cloudflare/types/hostnames/settings/tls_update_params.py +++ b/src/cloudflare/types/hostnames/settings/tls_update_params.py @@ -10,7 +10,7 @@ class TLSUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" setting_id: Required[Literal["ciphers", "min_tls_version", "http2"]] diff --git a/src/cloudflare/types/hyperdrive/config_create_params.py b/src/cloudflare/types/hyperdrive/config_create_params.py index 8cca81962eb..eeea86a6aed 100644 --- a/src/cloudflare/types/hyperdrive/config_create_params.py +++ b/src/cloudflare/types/hyperdrive/config_create_params.py @@ -19,7 +19,7 @@ class ConfigCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Define configurations using a unique string identifier.""" name: Required[str] diff --git a/src/cloudflare/types/hyperdrive/config_edit_params.py b/src/cloudflare/types/hyperdrive/config_edit_params.py index 8b5331133c2..97687cce4e7 100644 --- a/src/cloudflare/types/hyperdrive/config_edit_params.py +++ b/src/cloudflare/types/hyperdrive/config_edit_params.py @@ -20,7 +20,7 @@ class ConfigEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Define configurations using a unique string identifier.""" caching: Caching diff --git a/src/cloudflare/types/hyperdrive/config_update_params.py b/src/cloudflare/types/hyperdrive/config_update_params.py index 22dda91d257..3bb71bcea7c 100644 --- a/src/cloudflare/types/hyperdrive/config_update_params.py +++ b/src/cloudflare/types/hyperdrive/config_update_params.py @@ -19,7 +19,7 @@ class ConfigUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Define configurations using a unique string identifier.""" name: Required[str] diff --git a/src/cloudflare/types/iam/permission_group_list_params.py b/src/cloudflare/types/iam/permission_group_list_params.py index 55b2cd6a8f0..04f58ce75ce 100644 --- a/src/cloudflare/types/iam/permission_group_list_params.py +++ b/src/cloudflare/types/iam/permission_group_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PermissionGroupListParams"] class PermissionGroupListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: str diff --git a/src/cloudflare/types/iam/resource_group_create_params.py b/src/cloudflare/types/iam/resource_group_create_params.py index 8d40344c688..f732c8d93d1 100644 --- a/src/cloudflare/types/iam/resource_group_create_params.py +++ b/src/cloudflare/types/iam/resource_group_create_params.py @@ -9,7 +9,7 @@ class ResourceGroupCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: Required[str] diff --git a/src/cloudflare/types/iam/resource_group_list_params.py b/src/cloudflare/types/iam/resource_group_list_params.py index 8698adff09d..847d73fcdac 100644 --- a/src/cloudflare/types/iam/resource_group_list_params.py +++ b/src/cloudflare/types/iam/resource_group_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ResourceGroupListParams"] class ResourceGroupListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: str diff --git a/src/cloudflare/types/iam/resource_group_update_params.py b/src/cloudflare/types/iam/resource_group_update_params.py index 589d9dd1608..14274c889a0 100644 --- a/src/cloudflare/types/iam/resource_group_update_params.py +++ b/src/cloudflare/types/iam/resource_group_update_params.py @@ -9,7 +9,7 @@ class ResourceGroupUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: str diff --git a/src/cloudflare/types/iam/sso_create_params.py b/src/cloudflare/types/iam/sso_create_params.py index 666fee43912..ec1076e8d0a 100644 --- a/src/cloudflare/types/iam/sso_create_params.py +++ b/src/cloudflare/types/iam/sso_create_params.py @@ -8,7 +8,7 @@ class SSOCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" email_domain: Required[str] diff --git a/src/cloudflare/types/iam/sso_update_params.py b/src/cloudflare/types/iam/sso_update_params.py index add3b23a702..6f337f80b01 100644 --- a/src/cloudflare/types/iam/sso_update_params.py +++ b/src/cloudflare/types/iam/sso_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SSOUpdateParams"] class SSOUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" enabled: bool diff --git a/src/cloudflare/types/iam/user_group_create_params.py b/src/cloudflare/types/iam/user_group_create_params.py index 76e64e058db..a4161c2002d 100644 --- a/src/cloudflare/types/iam/user_group_create_params.py +++ b/src/cloudflare/types/iam/user_group_create_params.py @@ -9,13 +9,13 @@ class UserGroupCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: Required[str] """Name of the User group.""" - policies: Required[Iterable[Policy]] + policies: Iterable[Policy] """Policies attached to the User group""" diff --git a/src/cloudflare/types/iam/user_group_list_params.py b/src/cloudflare/types/iam/user_group_list_params.py index 11b09bafb8c..c4dc1a81797 100644 --- a/src/cloudflare/types/iam/user_group_list_params.py +++ b/src/cloudflare/types/iam/user_group_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,18 +10,14 @@ class UserGroupListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: str """ID of the user group to be fetched.""" - direction: str - """The sort order of returned user groups by name. - - Default sort order is ascending. To switch to descending, set this parameter to - "desc" - """ + direction: Literal["asc", "desc"] + """The sort order of returned user groups by name (ascending or descending).""" fuzzy_name: Annotated[str, PropertyInfo(alias="fuzzyName")] """A string used for searching for user groups containing that substring.""" diff --git a/src/cloudflare/types/iam/user_group_update_params.py b/src/cloudflare/types/iam/user_group_update_params.py index 59885183c15..19d6be93124 100644 --- a/src/cloudflare/types/iam/user_group_update_params.py +++ b/src/cloudflare/types/iam/user_group_update_params.py @@ -9,7 +9,7 @@ class UserGroupUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" name: str diff --git a/src/cloudflare/types/iam/user_groups/__init__.py b/src/cloudflare/types/iam/user_groups/__init__.py index 61081ac868f..1f888750400 100644 --- a/src/cloudflare/types/iam/user_groups/__init__.py +++ b/src/cloudflare/types/iam/user_groups/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .member_list_params import MemberListParams as MemberListParams +from .member_get_response import MemberGetResponse as MemberGetResponse from .member_create_params import MemberCreateParams as MemberCreateParams from .member_list_response import MemberListResponse as MemberListResponse from .member_update_params import MemberUpdateParams as MemberUpdateParams diff --git a/src/cloudflare/types/iam/user_groups/member_create_params.py b/src/cloudflare/types/iam/user_groups/member_create_params.py index ca4c234cfbf..e501ea31e6a 100644 --- a/src/cloudflare/types/iam/user_groups/member_create_params.py +++ b/src/cloudflare/types/iam/user_groups/member_create_params.py @@ -5,16 +5,16 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["MemberCreateParams", "Body"] +__all__ = ["MemberCreateParams", "Member"] class MemberCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" - body: Required[Iterable[Body]] + members: Required[Iterable[Member]] -class Body(TypedDict, total=False): +class Member(TypedDict, total=False): id: Required[str] """The identifier of an existing account Member.""" diff --git a/src/cloudflare/types/iam/user_groups/member_get_response.py b/src/cloudflare/types/iam/user_groups/member_get_response.py new file mode 100644 index 00000000000..9a07f1ff525 --- /dev/null +++ b/src/cloudflare/types/iam/user_groups/member_get_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MemberGetResponse", "User"] + + +class User(BaseModel): + """Details of the user associated with this membership.""" + + id: Optional[str] = None + """User identifier tag.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + first_name: Optional[str] = None + """User's first name.""" + + last_name: Optional[str] = None + """User's last name.""" + + +class MemberGetResponse(BaseModel): + """Detailed member information for a User Group member.""" + + id: str + """Account member identifier.""" + + created_at: Optional[datetime] = None + """When the member was added to the user group.""" + + email: Optional[str] = None + """The contact email address of the user.""" + + status: Optional[Literal["accepted", "pending"]] = None + """The member's status in the account.""" + + user: Optional[User] = None + """Details of the user associated with this membership.""" diff --git a/src/cloudflare/types/iam/user_groups/member_list_params.py b/src/cloudflare/types/iam/user_groups/member_list_params.py index 25f81527a16..55d530527f7 100644 --- a/src/cloudflare/types/iam/user_groups/member_list_params.py +++ b/src/cloudflare/types/iam/user_groups/member_list_params.py @@ -2,15 +2,23 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo __all__ = ["MemberListParams"] class MemberListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" + direction: Literal["asc", "desc"] + """The sort order of returned user group members by email.""" + + fuzzy_email: Annotated[str, PropertyInfo(alias="fuzzyEmail")] + """A string used for filtering members by partial email match.""" + page: float """Page number of paginated results.""" diff --git a/src/cloudflare/types/iam/user_groups/member_update_params.py b/src/cloudflare/types/iam/user_groups/member_update_params.py index 69f572b934c..0c400b9bed0 100644 --- a/src/cloudflare/types/iam/user_groups/member_update_params.py +++ b/src/cloudflare/types/iam/user_groups/member_update_params.py @@ -5,17 +5,17 @@ from typing import Iterable from typing_extensions import Required, TypedDict -__all__ = ["MemberUpdateParams", "Body"] +__all__ = ["MemberUpdateParams", "Member"] class MemberUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" - body: Required[Iterable[Body]] + members: Required[Iterable[Member]] """Set/Replace members to a user group.""" -class Body(TypedDict, total=False): +class Member(TypedDict, total=False): id: Required[str] """The identifier of an existing account Member.""" diff --git a/src/cloudflare/types/images/v1/variant_create_params.py b/src/cloudflare/types/images/v1/variant_create_params.py index e5f02341023..ea2907aca25 100644 --- a/src/cloudflare/types/images/v1/variant_create_params.py +++ b/src/cloudflare/types/images/v1/variant_create_params.py @@ -10,7 +10,7 @@ class VariantCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: Required[str] diff --git a/src/cloudflare/types/images/v1/variant_edit_params.py b/src/cloudflare/types/images/v1/variant_edit_params.py index 51203ed6fdc..8f36382f9af 100644 --- a/src/cloudflare/types/images/v1/variant_edit_params.py +++ b/src/cloudflare/types/images/v1/variant_edit_params.py @@ -10,7 +10,7 @@ class VariantEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" options: Required[Options] diff --git a/src/cloudflare/types/images/v1_create_params.py b/src/cloudflare/types/images/v1_create_params.py index 00eef1e087e..87764baa3a7 100644 --- a/src/cloudflare/types/images/v1_create_params.py +++ b/src/cloudflare/types/images/v1_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._types import FileTypes from ..._utils import PropertyInfo @@ -11,7 +11,7 @@ class V1CreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: str diff --git a/src/cloudflare/types/images/v1_edit_params.py b/src/cloudflare/types/images/v1_edit_params.py index 7473842ce3c..47b3f325861 100644 --- a/src/cloudflare/types/images/v1_edit_params.py +++ b/src/cloudflare/types/images/v1_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class V1EditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" creator: str diff --git a/src/cloudflare/types/images/v1_list_params.py b/src/cloudflare/types/images/v1_list_params.py index 390f47274fa..4e726436864 100644 --- a/src/cloudflare/types/images/v1_list_params.py +++ b/src/cloudflare/types/images/v1_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["V1ListParams"] class V1ListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" creator: Optional[str] diff --git a/src/cloudflare/types/images/v2/direct_upload_create_params.py b/src/cloudflare/types/images/v2/direct_upload_create_params.py index 0a9dd905fe3..f4c7b7971b1 100644 --- a/src/cloudflare/types/images/v2/direct_upload_create_params.py +++ b/src/cloudflare/types/images/v2/direct_upload_create_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class DirectUploadCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" id: str diff --git a/src/cloudflare/types/images/v2_list_params.py b/src/cloudflare/types/images/v2_list_params.py index 158ca0420a7..05b6d34de6d 100644 --- a/src/cloudflare/types/images/v2_list_params.py +++ b/src/cloudflare/types/images/v2_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -11,7 +11,7 @@ class V2ListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier tag.""" continuation_token: Optional[str] diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py index cb9d40f1b0e..dea6bc517db 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_class_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -14,7 +14,7 @@ class IssueClassParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dismissed: bool diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_dismiss_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_dismiss_params.py index c251faddaed..9e99366289a 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_dismiss_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_dismiss_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IssueDismissParams"] class IssueDismissParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dismiss: bool diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py index 15df237aa6c..2966798f2b0 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -14,7 +14,7 @@ class IssueListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dismissed: bool diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py index 8b3debd0d12..be70edbc260 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_severity_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -14,7 +14,7 @@ class IssueSeverityParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dismissed: bool diff --git a/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py b/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py index 8be99bb2c3b..25cd8bde53f 100644 --- a/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py +++ b/src/cloudflare/types/intel/attack_surface_report/issue_type_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -14,7 +14,7 @@ class IssueTypeParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dismissed: bool diff --git a/src/cloudflare/types/intel/dns_list_params.py b/src/cloudflare/types/intel/dns_list_params.py index d65519fa6c7..0d040386777 100644 --- a/src/cloudflare/types/intel/dns_list_params.py +++ b/src/cloudflare/types/intel/dns_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import date -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class DNSListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" ipv4: str diff --git a/src/cloudflare/types/intel/domain_get_params.py b/src/cloudflare/types/intel/domain_get_params.py index d700eb7b0e6..42ba437d630 100644 --- a/src/cloudflare/types/intel/domain_get_params.py +++ b/src/cloudflare/types/intel/domain_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DomainGetParams"] class DomainGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" domain: str diff --git a/src/cloudflare/types/intel/domain_history_get_params.py b/src/cloudflare/types/intel/domain_history_get_params.py index 8e2479ee4b9..a4715231d50 100644 --- a/src/cloudflare/types/intel/domain_history_get_params.py +++ b/src/cloudflare/types/intel/domain_history_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DomainHistoryGetParams"] class DomainHistoryGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" domain: str diff --git a/src/cloudflare/types/intel/domains/bulk_get_params.py b/src/cloudflare/types/intel/domains/bulk_get_params.py index 04bfcf0fb92..5fd9ed9f983 100644 --- a/src/cloudflare/types/intel/domains/bulk_get_params.py +++ b/src/cloudflare/types/intel/domains/bulk_get_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class BulkGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" domain: SequenceNotStr[str] diff --git a/src/cloudflare/types/intel/indicator_feed_create_params.py b/src/cloudflare/types/intel/indicator_feed_create_params.py index 90a850c9215..f5e9d38e6b4 100644 --- a/src/cloudflare/types/intel/indicator_feed_create_params.py +++ b/src/cloudflare/types/intel/indicator_feed_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IndicatorFeedCreateParams"] class IndicatorFeedCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" description: str diff --git a/src/cloudflare/types/intel/indicator_feed_update_params.py b/src/cloudflare/types/intel/indicator_feed_update_params.py index 2553b63b6eb..8709cabc628 100644 --- a/src/cloudflare/types/intel/indicator_feed_update_params.py +++ b/src/cloudflare/types/intel/indicator_feed_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IndicatorFeedUpdateParams"] class IndicatorFeedUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" description: str diff --git a/src/cloudflare/types/intel/indicator_feeds/permission_create_params.py b/src/cloudflare/types/intel/indicator_feeds/permission_create_params.py index 70b13b60b79..2b6cedb4150 100644 --- a/src/cloudflare/types/intel/indicator_feeds/permission_create_params.py +++ b/src/cloudflare/types/intel/indicator_feeds/permission_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PermissionCreateParams"] class PermissionCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" account_tag: str diff --git a/src/cloudflare/types/intel/indicator_feeds/permission_delete_params.py b/src/cloudflare/types/intel/indicator_feeds/permission_delete_params.py index 2ab9fce8c89..7720a9680ab 100644 --- a/src/cloudflare/types/intel/indicator_feeds/permission_delete_params.py +++ b/src/cloudflare/types/intel/indicator_feeds/permission_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PermissionDeleteParams"] class PermissionDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" account_tag: str diff --git a/src/cloudflare/types/intel/indicator_feeds/snapshot_update_params.py b/src/cloudflare/types/intel/indicator_feeds/snapshot_update_params.py index ee38fd8b059..ec0d386ca4f 100644 --- a/src/cloudflare/types/intel/indicator_feeds/snapshot_update_params.py +++ b/src/cloudflare/types/intel/indicator_feeds/snapshot_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SnapshotUpdateParams"] class SnapshotUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" source: str diff --git a/src/cloudflare/types/intel/ip_get_params.py b/src/cloudflare/types/intel/ip_get_params.py index 446652d86f0..ac4b4ee5f88 100644 --- a/src/cloudflare/types/intel/ip_get_params.py +++ b/src/cloudflare/types/intel/ip_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IPGetParams"] class IPGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" ipv4: str diff --git a/src/cloudflare/types/intel/miscategorization_create_params.py b/src/cloudflare/types/intel/miscategorization_create_params.py index 929afefc733..3be6db1feeb 100644 --- a/src/cloudflare/types/intel/miscategorization_create_params.py +++ b/src/cloudflare/types/intel/miscategorization_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Iterable, Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MiscategorizationCreateParams"] class MiscategorizationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" content_adds: Iterable[int] diff --git a/src/cloudflare/types/intel/whois_get_params.py b/src/cloudflare/types/intel/whois_get_params.py index 9d1ba62e454..6bcf3ee91d0 100644 --- a/src/cloudflare/types/intel/whois_get_params.py +++ b/src/cloudflare/types/intel/whois_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WhoisGetParams"] class WhoisGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use to uniquely identify or reference the resource.""" domain: str diff --git a/src/cloudflare/types/keyless_certificates/keyless_certificate_create_params.py b/src/cloudflare/types/keyless_certificates/keyless_certificate_create_params.py index 282a7092927..77056c21b7d 100644 --- a/src/cloudflare/types/keyless_certificates/keyless_certificate_create_params.py +++ b/src/cloudflare/types/keyless_certificates/keyless_certificate_create_params.py @@ -11,7 +11,7 @@ class KeylessCertificateCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/keyless_certificates/keyless_certificate_edit_params.py b/src/cloudflare/types/keyless_certificates/keyless_certificate_edit_params.py index 51de2990b6d..298e4bfe4b6 100644 --- a/src/cloudflare/types/keyless_certificates/keyless_certificate_edit_params.py +++ b/src/cloudflare/types/keyless_certificates/keyless_certificate_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .tunnel_param import TunnelParam @@ -10,7 +10,7 @@ class KeylessCertificateEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: bool diff --git a/src/cloudflare/types/kv/namespace_bulk_delete_params.py b/src/cloudflare/types/kv/namespace_bulk_delete_params.py index 8bdb4fa7ccf..b5c49385eb5 100644 --- a/src/cloudflare/types/kv/namespace_bulk_delete_params.py +++ b/src/cloudflare/types/kv/namespace_bulk_delete_params.py @@ -10,7 +10,7 @@ class NamespaceBulkDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/kv/namespace_bulk_get_params.py b/src/cloudflare/types/kv/namespace_bulk_get_params.py index c0c85df59c8..4f5db117c23 100644 --- a/src/cloudflare/types/kv/namespace_bulk_get_params.py +++ b/src/cloudflare/types/kv/namespace_bulk_get_params.py @@ -11,7 +11,7 @@ class NamespaceBulkGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" keys: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/kv/namespace_bulk_update_params.py b/src/cloudflare/types/kv/namespace_bulk_update_params.py index a159c3e35fe..d56c1a14bbb 100644 --- a/src/cloudflare/types/kv/namespace_bulk_update_params.py +++ b/src/cloudflare/types/kv/namespace_bulk_update_params.py @@ -9,7 +9,7 @@ class NamespaceBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/kv/namespace_create_params.py b/src/cloudflare/types/kv/namespace_create_params.py index ed0c33d606c..85397033b26 100644 --- a/src/cloudflare/types/kv/namespace_create_params.py +++ b/src/cloudflare/types/kv/namespace_create_params.py @@ -8,7 +8,7 @@ class NamespaceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" title: Required[str] diff --git a/src/cloudflare/types/kv/namespace_list_params.py b/src/cloudflare/types/kv/namespace_list_params.py index 5cc982a7e96..8c217e6fef4 100644 --- a/src/cloudflare/types/kv/namespace_list_params.py +++ b/src/cloudflare/types/kv/namespace_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["NamespaceListParams"] class NamespaceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/kv/namespace_update_params.py b/src/cloudflare/types/kv/namespace_update_params.py index f113a945292..71f317ca4e4 100644 --- a/src/cloudflare/types/kv/namespace_update_params.py +++ b/src/cloudflare/types/kv/namespace_update_params.py @@ -8,7 +8,7 @@ class NamespaceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" title: Required[str] diff --git a/src/cloudflare/types/kv/namespaces/key_bulk_delete_params.py b/src/cloudflare/types/kv/namespaces/key_bulk_delete_params.py index 522f5ae7585..4ca950ad537 100644 --- a/src/cloudflare/types/kv/namespaces/key_bulk_delete_params.py +++ b/src/cloudflare/types/kv/namespaces/key_bulk_delete_params.py @@ -10,7 +10,7 @@ class KeyBulkDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/kv/namespaces/key_bulk_get_params.py b/src/cloudflare/types/kv/namespaces/key_bulk_get_params.py index f978cb2bf6d..807dcd6a7f6 100644 --- a/src/cloudflare/types/kv/namespaces/key_bulk_get_params.py +++ b/src/cloudflare/types/kv/namespaces/key_bulk_get_params.py @@ -11,7 +11,7 @@ class KeyBulkGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" keys: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/kv/namespaces/key_bulk_update_params.py b/src/cloudflare/types/kv/namespaces/key_bulk_update_params.py index 4339061b8b8..e7a48702ec1 100644 --- a/src/cloudflare/types/kv/namespaces/key_bulk_update_params.py +++ b/src/cloudflare/types/kv/namespaces/key_bulk_update_params.py @@ -9,7 +9,7 @@ class KeyBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/kv/namespaces/key_list_params.py b/src/cloudflare/types/kv/namespaces/key_list_params.py index 0914506952d..804e1ee1c56 100644 --- a/src/cloudflare/types/kv/namespaces/key_list_params.py +++ b/src/cloudflare/types/kv/namespaces/key_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["KeyListParams"] class KeyListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cursor: str diff --git a/src/cloudflare/types/kv/namespaces/value_update_params.py b/src/cloudflare/types/kv/namespaces/value_update_params.py index ccebae68bbf..320a496f11c 100644 --- a/src/cloudflare/types/kv/namespaces/value_update_params.py +++ b/src/cloudflare/types/kv/namespaces/value_update_params.py @@ -11,7 +11,7 @@ class ValueUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" namespace_id: Required[str] diff --git a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py index 63051b483f0..4aa1306de9c 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_create_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DetectionCreateParams"] class DetectionCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" password: str diff --git a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py index 72e0b69b0d8..b89243110b3 100644 --- a/src/cloudflare/types/leaked_credential_checks/detection_update_params.py +++ b/src/cloudflare/types/leaked_credential_checks/detection_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DetectionUpdateParams"] class DetectionUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" password: str diff --git a/src/cloudflare/types/leaked_credential_checks/leaked_credential_check_create_params.py b/src/cloudflare/types/leaked_credential_checks/leaked_credential_check_create_params.py index bab18811219..3e89ee960d5 100644 --- a/src/cloudflare/types/leaked_credential_checks/leaked_credential_check_create_params.py +++ b/src/cloudflare/types/leaked_credential_checks/leaked_credential_check_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LeakedCredentialCheckCreateParams"] class LeakedCredentialCheckCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" enabled: bool diff --git a/src/cloudflare/types/load_balancers/load_balancer_create_params.py b/src/cloudflare/types/load_balancers/load_balancer_create_params.py index 65470830e70..39dcc94d3d3 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_create_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_create_params.py @@ -19,7 +19,7 @@ class LoadBalancerCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] default_pools: Required[SequenceNotStr[DefaultPools]] """A list of pool IDs ordered by their failover priority. diff --git a/src/cloudflare/types/load_balancers/load_balancer_edit_params.py b/src/cloudflare/types/load_balancers/load_balancer_edit_params.py index bf49036e0b3..88da48c58e3 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_edit_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr from .rules_param import RulesParam @@ -19,7 +19,7 @@ class LoadBalancerEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] adaptive_routing: AdaptiveRoutingParam """ diff --git a/src/cloudflare/types/load_balancers/load_balancer_update_params.py b/src/cloudflare/types/load_balancers/load_balancer_update_params.py index 8576639eedc..0908929cb3e 100644 --- a/src/cloudflare/types/load_balancers/load_balancer_update_params.py +++ b/src/cloudflare/types/load_balancers/load_balancer_update_params.py @@ -19,7 +19,7 @@ class LoadBalancerUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] default_pools: Required[SequenceNotStr[DefaultPools]] """A list of pool IDs ordered by their failover priority. diff --git a/src/cloudflare/types/load_balancers/monitor_create_params.py b/src/cloudflare/types/load_balancers/monitor_create_params.py index 5dddeacf779..b68e28a1226 100644 --- a/src/cloudflare/types/load_balancers/monitor_create_params.py +++ b/src/cloudflare/types/load_balancers/monitor_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class MonitorCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_insecure: bool diff --git a/src/cloudflare/types/load_balancers/monitor_edit_params.py b/src/cloudflare/types/load_balancers/monitor_edit_params.py index b96dc8f1aef..e826841b064 100644 --- a/src/cloudflare/types/load_balancers/monitor_edit_params.py +++ b/src/cloudflare/types/load_balancers/monitor_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class MonitorEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_insecure: bool diff --git a/src/cloudflare/types/load_balancers/monitor_group_create_params.py b/src/cloudflare/types/load_balancers/monitor_group_create_params.py index c1ca537ceef..0d9b6714ddd 100644 --- a/src/cloudflare/types/load_balancers/monitor_group_create_params.py +++ b/src/cloudflare/types/load_balancers/monitor_group_create_params.py @@ -9,7 +9,7 @@ class MonitorGroupCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" id: Required[str] diff --git a/src/cloudflare/types/load_balancers/monitor_group_edit_params.py b/src/cloudflare/types/load_balancers/monitor_group_edit_params.py index 8fbc9d8e28d..212f85f5360 100644 --- a/src/cloudflare/types/load_balancers/monitor_group_edit_params.py +++ b/src/cloudflare/types/load_balancers/monitor_group_edit_params.py @@ -9,7 +9,7 @@ class MonitorGroupEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" id: Required[str] diff --git a/src/cloudflare/types/load_balancers/monitor_group_update_params.py b/src/cloudflare/types/load_balancers/monitor_group_update_params.py index 13d183a5a4e..9122012730b 100644 --- a/src/cloudflare/types/load_balancers/monitor_group_update_params.py +++ b/src/cloudflare/types/load_balancers/monitor_group_update_params.py @@ -9,7 +9,7 @@ class MonitorGroupUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" id: Required[str] diff --git a/src/cloudflare/types/load_balancers/monitor_update_params.py b/src/cloudflare/types/load_balancers/monitor_update_params.py index b24b574a4bf..77c2394d060 100644 --- a/src/cloudflare/types/load_balancers/monitor_update_params.py +++ b/src/cloudflare/types/load_balancers/monitor_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class MonitorUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_insecure: bool diff --git a/src/cloudflare/types/load_balancers/monitors/preview_create_params.py b/src/cloudflare/types/load_balancers/monitors/preview_create_params.py index 2e2cdbbb7cc..c9a8d5b7b68 100644 --- a/src/cloudflare/types/load_balancers/monitors/preview_create_params.py +++ b/src/cloudflare/types/load_balancers/monitors/preview_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class PreviewCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_insecure: bool diff --git a/src/cloudflare/types/load_balancers/pool_bulk_edit_params.py b/src/cloudflare/types/load_balancers/pool_bulk_edit_params.py index 3d838087463..af6bc6635c8 100644 --- a/src/cloudflare/types/load_balancers/pool_bulk_edit_params.py +++ b/src/cloudflare/types/load_balancers/pool_bulk_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PoolBulkEditParams"] class PoolBulkEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" notification_email: Literal[""] diff --git a/src/cloudflare/types/load_balancers/pool_create_params.py b/src/cloudflare/types/load_balancers/pool_create_params.py index 6e86952dd1c..08779830381 100644 --- a/src/cloudflare/types/load_balancers/pool_create_params.py +++ b/src/cloudflare/types/load_balancers/pool_create_params.py @@ -14,7 +14,7 @@ class PoolCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/load_balancers/pool_edit_params.py b/src/cloudflare/types/load_balancers/pool_edit_params.py index 6b5257d99f8..e3f89941084 100644 --- a/src/cloudflare/types/load_balancers/pool_edit_params.py +++ b/src/cloudflare/types/load_balancers/pool_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List, Iterable, Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .check_region import CheckRegion from .origin_param import OriginParam @@ -15,7 +15,7 @@ class PoolEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" check_regions: Optional[List[CheckRegion]] diff --git a/src/cloudflare/types/load_balancers/pool_list_params.py b/src/cloudflare/types/load_balancers/pool_list_params.py index 5c2f6673a2d..35367c51396 100644 --- a/src/cloudflare/types/load_balancers/pool_list_params.py +++ b/src/cloudflare/types/load_balancers/pool_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PoolListParams"] class PoolListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" monitor: str diff --git a/src/cloudflare/types/load_balancers/pool_update_params.py b/src/cloudflare/types/load_balancers/pool_update_params.py index c5b35c8d7a8..bfcf15e6b84 100644 --- a/src/cloudflare/types/load_balancers/pool_update_params.py +++ b/src/cloudflare/types/load_balancers/pool_update_params.py @@ -15,7 +15,7 @@ class PoolUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/load_balancers/pools/health_create_params.py b/src/cloudflare/types/load_balancers/pools/health_create_params.py index f71a9cd8a79..4cc0852bba0 100644 --- a/src/cloudflare/types/load_balancers/pools/health_create_params.py +++ b/src/cloudflare/types/load_balancers/pools/health_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class HealthCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_insecure: bool diff --git a/src/cloudflare/types/load_balancers/region_list_params.py b/src/cloudflare/types/load_balancers/region_list_params.py index a6a8751f157..8dbdd2156b8 100644 --- a/src/cloudflare/types/load_balancers/region_list_params.py +++ b/src/cloudflare/types/load_balancers/region_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RegionListParams"] class RegionListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" country_code_a2: str diff --git a/src/cloudflare/types/load_balancers/search_list_params.py b/src/cloudflare/types/load_balancers/search_list_params.py index 9d10e2f5b56..73c63622446 100644 --- a/src/cloudflare/types/load_balancers/search_list_params.py +++ b/src/cloudflare/types/load_balancers/search_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SearchListParams"] class SearchListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: float diff --git a/src/cloudflare/types/logpush/edge_create_params.py b/src/cloudflare/types/logpush/edge_create_params.py index 27ae9e7609c..339abcf0286 100644 --- a/src/cloudflare/types/logpush/edge_create_params.py +++ b/src/cloudflare/types/logpush/edge_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EdgeCreateParams"] class EdgeCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" fields: str diff --git a/src/cloudflare/types/logpush/job_create_params.py b/src/cloudflare/types/logpush/job_create_params.py index 53236f7b18c..15b72c6c169 100644 --- a/src/cloudflare/types/logpush/job_create_params.py +++ b/src/cloudflare/types/logpush/job_create_params.py @@ -38,6 +38,7 @@ class JobCreateParams(TypedDict, total=False): "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", diff --git a/src/cloudflare/types/logpush/logpush_job.py b/src/cloudflare/types/logpush/logpush_job.py index 3d38bb4c678..3233139adf2 100644 --- a/src/cloudflare/types/logpush/logpush_job.py +++ b/src/cloudflare/types/logpush/logpush_job.py @@ -28,6 +28,7 @@ class LogpushJob(BaseModel): "dns_firewall_logs", "dns_logs", "email_security_alerts", + "email_security_post_delivery_events", "firewall_events", "gateway_dns", "gateway_http", diff --git a/src/cloudflare/types/logpush/output_options.py b/src/cloudflare/types/logpush/output_options.py index 55196f3e139..51f66c686b0 100644 --- a/src/cloudflare/types/logpush/output_options.py +++ b/src/cloudflare/types/logpush/output_options.py @@ -38,6 +38,12 @@ class OutputOptions(BaseModel): specify all the fields names you are interested in. """ + merge_subrequests: Optional[bool] = None + """If set to true, subrequests will be merged into the parent request. + + Only supported for the `http_requests` dataset. + """ + output_type: Optional[Literal["ndjson", "csv"]] = None """Specifies the output type, such as `ndjson` or `csv`. diff --git a/src/cloudflare/types/logpush/output_options_param.py b/src/cloudflare/types/logpush/output_options_param.py index f592a97e929..66e0821dbf8 100644 --- a/src/cloudflare/types/logpush/output_options_param.py +++ b/src/cloudflare/types/logpush/output_options_param.py @@ -39,6 +39,12 @@ class OutputOptionsParam(TypedDict, total=False): specify all the fields names you are interested in. """ + merge_subrequests: Optional[bool] + """If set to true, subrequests will be merged into the parent request. + + Only supported for the `http_requests` dataset. + """ + output_type: Literal["ndjson", "csv"] """Specifies the output type, such as `ndjson` or `csv`. diff --git a/src/cloudflare/types/logs/control/cmb/config_create_params.py b/src/cloudflare/types/logs/control/cmb/config_create_params.py index 2a7d6621af2..4fb77a53222 100644 --- a/src/cloudflare/types/logs/control/cmb/config_create_params.py +++ b/src/cloudflare/types/logs/control/cmb/config_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ConfigCreateParams"] class ConfigCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allow_out_of_region_access: bool diff --git a/src/cloudflare/types/logs/control/retention_create_params.py b/src/cloudflare/types/logs/control/retention_create_params.py index ce89e881a72..7d14eaf90f6 100644 --- a/src/cloudflare/types/logs/control/retention_create_params.py +++ b/src/cloudflare/types/logs/control/retention_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RetentionCreateParams"] class RetentionCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" flag: bool diff --git a/src/cloudflare/types/logs/rayid_get_params.py b/src/cloudflare/types/logs/rayid_get_params.py index 2c6d1b19f81..d80a596c1a4 100644 --- a/src/cloudflare/types/logs/rayid_get_params.py +++ b/src/cloudflare/types/logs/rayid_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RayIDGetParams"] class RayIDGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" fields: str diff --git a/src/cloudflare/types/logs/received_get_params.py b/src/cloudflare/types/logs/received_get_params.py index afe8a96c6a5..859b062c5a4 100644 --- a/src/cloudflare/types/logs/received_get_params.py +++ b/src/cloudflare/types/logs/received_get_params.py @@ -9,7 +9,7 @@ class ReceivedGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" end: Required[Union[str, int]] diff --git a/src/cloudflare/types/magic_cloud_networking/catalog_sync_create_params.py b/src/cloudflare/types/magic_cloud_networking/catalog_sync_create_params.py index cf1851eb702..18c8dd7a081 100644 --- a/src/cloudflare/types/magic_cloud_networking/catalog_sync_create_params.py +++ b/src/cloudflare/types/magic_cloud_networking/catalog_sync_create_params.py @@ -8,7 +8,7 @@ class CatalogSyncCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] destination_type: Required[Literal["NONE", "ZERO_TRUST_LIST"]] diff --git a/src/cloudflare/types/magic_cloud_networking/catalog_sync_delete_params.py b/src/cloudflare/types/magic_cloud_networking/catalog_sync_delete_params.py index d3f1be943e1..b8422d6eef9 100644 --- a/src/cloudflare/types/magic_cloud_networking/catalog_sync_delete_params.py +++ b/src/cloudflare/types/magic_cloud_networking/catalog_sync_delete_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CatalogSyncDeleteParams"] class CatalogSyncDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] delete_destination: bool diff --git a/src/cloudflare/types/magic_cloud_networking/catalog_sync_edit_params.py b/src/cloudflare/types/magic_cloud_networking/catalog_sync_edit_params.py index 7bab333f808..4d4c617d89a 100644 --- a/src/cloudflare/types/magic_cloud_networking/catalog_sync_edit_params.py +++ b/src/cloudflare/types/magic_cloud_networking/catalog_sync_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CatalogSyncEditParams"] class CatalogSyncEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: str diff --git a/src/cloudflare/types/magic_cloud_networking/catalog_sync_update_params.py b/src/cloudflare/types/magic_cloud_networking/catalog_sync_update_params.py index eb4e3f376d6..b3503d5f411 100644 --- a/src/cloudflare/types/magic_cloud_networking/catalog_sync_update_params.py +++ b/src/cloudflare/types/magic_cloud_networking/catalog_sync_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CatalogSyncUpdateParams"] class CatalogSyncUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: str diff --git a/src/cloudflare/types/magic_cloud_networking/catalog_syncs/prebuilt_policy_list_params.py b/src/cloudflare/types/magic_cloud_networking/catalog_syncs/prebuilt_policy_list_params.py index eab714d7aea..d13cde44409 100644 --- a/src/cloudflare/types/magic_cloud_networking/catalog_syncs/prebuilt_policy_list_params.py +++ b/src/cloudflare/types/magic_cloud_networking/catalog_syncs/prebuilt_policy_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PrebuiltPolicyListParams"] class PrebuiltPolicyListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] destination_type: Literal["NONE", "ZERO_TRUST_LIST"] """Specify type of destination, omit to return all.""" diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_create_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_create_params.py index 5881c5c470a..066d1a6d3bd 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_create_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_create_params.py @@ -8,7 +8,7 @@ class CloudIntegrationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cloud_type: Required[Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]] diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_discover_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_discover_params.py index aa9d3fd7121..f54258bfcbe 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_discover_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_discover_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudIntegrationDiscoverParams"] class CloudIntegrationDiscoverParams(TypedDict, total=False): - account_id: str + account_id: Required[str] v2: bool diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_edit_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_edit_params.py index c61e0dc37bf..e069ee25408 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_edit_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudIntegrationEditParams"] class CloudIntegrationEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] aws_arn: str diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_get_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_get_params.py index 351552b3b11..4a26230bc6f 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_get_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_get_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudIntegrationGetParams"] class CloudIntegrationGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] status: bool diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_list_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_list_params.py index 44ccaa4ee44..94bead9742a 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_list_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudIntegrationListParams"] class CloudIntegrationListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cloudflare: bool diff --git a/src/cloudflare/types/magic_cloud_networking/cloud_integration_update_params.py b/src/cloudflare/types/magic_cloud_networking/cloud_integration_update_params.py index 474e6389a70..9321e19b5d8 100644 --- a/src/cloudflare/types/magic_cloud_networking/cloud_integration_update_params.py +++ b/src/cloudflare/types/magic_cloud_networking/cloud_integration_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudIntegrationUpdateParams"] class CloudIntegrationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] aws_arn: str diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py index e4d908708cc..2893b07cfec 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py @@ -10,7 +10,7 @@ class OnRampCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cloud_type: Required[Literal["AWS", "AZURE", "GOOGLE"]] diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_delete_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_delete_params.py index e1a84679631..6ace6d226de 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_delete_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["OnRampDeleteParams"] class OnRampDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] destroy: bool diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_edit_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_edit_params.py index c090a078955..04cb0a141e5 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_edit_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class OnRampEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] attached_hubs: SequenceNotStr[str] diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_get_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_get_params.py index 4d1d34abafc..b3c8a9df5a2 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_get_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["OnRampGetParams"] class OnRampGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] planned_resources: bool diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_list_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_list_params.py index da82c3a2f7b..b7c660ad5c4 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_list_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["OnRampListParams"] class OnRampListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] desc: bool diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_update_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_update_params.py index b95345fb37b..bbcd6aae218 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_update_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class OnRampUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] attached_hubs: SequenceNotStr[str] diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_edit_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_edit_params.py index 3373cd8ae46..09fc69ad5fa 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_edit_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_edit_params.py @@ -10,6 +10,6 @@ class AddressSpaceEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] prefixes: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_update_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_update_params.py index be7bd19b1f7..ed1ef67b196 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_update_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramps/address_space_update_params.py @@ -10,6 +10,6 @@ class AddressSpaceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] prefixes: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/magic_cloud_networking/resource_export_params.py b/src/cloudflare/types/magic_cloud_networking/resource_export_params.py index 4fa80ae90af..73d6753fcc2 100644 --- a/src/cloudflare/types/magic_cloud_networking/resource_export_params.py +++ b/src/cloudflare/types/magic_cloud_networking/resource_export_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class ResourceExportParams(TypedDict, total=False): - account_id: str + account_id: Required[str] desc: bool diff --git a/src/cloudflare/types/magic_cloud_networking/resource_get_params.py b/src/cloudflare/types/magic_cloud_networking/resource_get_params.py index 24e9a01f861..e3f392e392a 100644 --- a/src/cloudflare/types/magic_cloud_networking/resource_get_params.py +++ b/src/cloudflare/types/magic_cloud_networking/resource_get_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ResourceGetParams"] class ResourceGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] v2: bool diff --git a/src/cloudflare/types/magic_cloud_networking/resource_list_params.py b/src/cloudflare/types/magic_cloud_networking/resource_list_params.py index 95edf7d2d94..d48313a1b22 100644 --- a/src/cloudflare/types/magic_cloud_networking/resource_list_params.py +++ b/src/cloudflare/types/magic_cloud_networking/resource_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class ResourceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cloudflare: bool diff --git a/src/cloudflare/types/magic_cloud_networking/resource_policy_preview_params.py b/src/cloudflare/types/magic_cloud_networking/resource_policy_preview_params.py index 132050189e7..81c74c2fef6 100644 --- a/src/cloudflare/types/magic_cloud_networking/resource_policy_preview_params.py +++ b/src/cloudflare/types/magic_cloud_networking/resource_policy_preview_params.py @@ -8,6 +8,6 @@ class ResourcePolicyPreviewParams(TypedDict, total=False): - account_id: str + account_id: Required[str] policy: Required[str] diff --git a/src/cloudflare/types/magic_network_monitoring/config_create_params.py b/src/cloudflare/types/magic_network_monitoring/config_create_params.py index b14c8fd4ee0..c6736af91a2 100644 --- a/src/cloudflare/types/magic_network_monitoring/config_create_params.py +++ b/src/cloudflare/types/magic_network_monitoring/config_create_params.py @@ -11,7 +11,7 @@ class ConfigCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] default_sampling: Required[float] """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_network_monitoring/config_edit_params.py b/src/cloudflare/types/magic_network_monitoring/config_edit_params.py index 53175b7822e..4248ff62f9d 100644 --- a/src/cloudflare/types/magic_network_monitoring/config_edit_params.py +++ b/src/cloudflare/types/magic_network_monitoring/config_edit_params.py @@ -11,7 +11,7 @@ class ConfigEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] default_sampling: float """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_network_monitoring/config_update_params.py b/src/cloudflare/types/magic_network_monitoring/config_update_params.py index 2102b658128..04530d1c37a 100644 --- a/src/cloudflare/types/magic_network_monitoring/config_update_params.py +++ b/src/cloudflare/types/magic_network_monitoring/config_update_params.py @@ -11,7 +11,7 @@ class ConfigUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] default_sampling: Required[float] """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_network_monitoring/rule_create_params.py b/src/cloudflare/types/magic_network_monitoring/rule_create_params.py index da89855d6e6..52508e9e9c6 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_create_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_create_params.py @@ -11,7 +11,7 @@ class RuleCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] automatic_advertisement: Required[Optional[bool]] """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py b/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py index 7d8692467f1..f446992f9f5 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_edit_params.py @@ -11,7 +11,7 @@ class RuleEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] automatic_advertisement: Required[Optional[bool]] """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_update_params.py b/src/cloudflare/types/magic_network_monitoring/rule_update_params.py index aa67dff760c..a20cd0e2800 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_update_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rule_update_params.py @@ -11,7 +11,7 @@ class RuleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] automatic_advertisement: Required[Optional[bool]] """ diff --git a/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_params.py b/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_params.py index 7ac6aac7182..ece6f001327 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_params.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_params.py @@ -8,6 +8,6 @@ class AdvertisementEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[object] diff --git a/src/cloudflare/types/magic_transit/app_create_params.py b/src/cloudflare/types/magic_transit/app_create_params.py index 12be828243a..33512d9db4e 100644 --- a/src/cloudflare/types/magic_transit/app_create_params.py +++ b/src/cloudflare/types/magic_transit/app_create_params.py @@ -10,7 +10,7 @@ class AppCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" name: Required[str] diff --git a/src/cloudflare/types/magic_transit/app_edit_params.py b/src/cloudflare/types/magic_transit/app_edit_params.py index 16ed1b5df1f..c9702e77697 100644 --- a/src/cloudflare/types/magic_transit/app_edit_params.py +++ b/src/cloudflare/types/magic_transit/app_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class AppEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" hostnames: SequenceNotStr[str] diff --git a/src/cloudflare/types/magic_transit/app_update_params.py b/src/cloudflare/types/magic_transit/app_update_params.py index 049137bea7d..4af8c5f1a63 100644 --- a/src/cloudflare/types/magic_transit/app_update_params.py +++ b/src/cloudflare/types/magic_transit/app_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class AppUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" hostnames: SequenceNotStr[str] diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_params.py b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_params.py index 215ae0a3e89..ab9e94f12de 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_params.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_params.py @@ -10,7 +10,7 @@ class CfInterconnectBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py index 1848ca46ce7..dea0aabfdeb 100644 --- a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py +++ b/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo from .health_check_param import HealthCheckParam @@ -11,7 +11,7 @@ class CfInterconnectUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" automatic_return_routing: bool diff --git a/src/cloudflare/types/magic_transit/connector_create_params.py b/src/cloudflare/types/magic_transit/connector_create_params.py index 3f44971637e..8ada6bdf956 100644 --- a/src/cloudflare/types/magic_transit/connector_create_params.py +++ b/src/cloudflare/types/magic_transit/connector_create_params.py @@ -11,7 +11,7 @@ class ConnectorCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" device: Required[Device] diff --git a/src/cloudflare/types/magic_transit/connector_edit_params.py b/src/cloudflare/types/magic_transit/connector_edit_params.py index 6379bcda7d4..56b44c01e3d 100644 --- a/src/cloudflare/types/magic_transit/connector_edit_params.py +++ b/src/cloudflare/types/magic_transit/connector_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class ConnectorEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" activated: bool diff --git a/src/cloudflare/types/magic_transit/connector_update_params.py b/src/cloudflare/types/magic_transit/connector_update_params.py index 3f0981eed37..9b046f584cc 100644 --- a/src/cloudflare/types/magic_transit/connector_update_params.py +++ b/src/cloudflare/types/magic_transit/connector_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class ConnectorUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" activated: bool diff --git a/src/cloudflare/types/magic_transit/connectors/event_list_params.py b/src/cloudflare/types/magic_transit/connectors/event_list_params.py index a16ed7d0a75..b8ba2917823 100644 --- a/src/cloudflare/types/magic_transit/connectors/event_list_params.py +++ b/src/cloudflare/types/magic_transit/connectors/event_list_params.py @@ -10,7 +10,7 @@ class EventListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" from_: Required[Annotated[float, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py index 693d36aceb1..b2c9a69b3a6 100644 --- a/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py +++ b/src/cloudflare/types/magic_transit/connectors/snapshot_list_params.py @@ -10,7 +10,7 @@ class SnapshotListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" from_: Required[Annotated[float, PropertyInfo(alias="from")]] diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_params.py index c4d426e717c..652e4f41702 100644 --- a/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_params.py +++ b/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_params.py @@ -10,7 +10,7 @@ class GRETunnelBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py index 9f06fa59db8..2e8e4a5b8e8 100644 --- a/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py +++ b/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py @@ -20,7 +20,7 @@ class GRETunnelCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" cloudflare_gre_endpoint: Required[str] diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py index 20e82286f02..0081115a1d3 100644 --- a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py +++ b/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py @@ -13,7 +13,7 @@ class GRETunnelUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" cloudflare_gre_endpoint: Required[str] diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_params.py index 21878c492f1..c35b7181e30 100644 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_params.py +++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_params.py @@ -10,7 +10,7 @@ class IPSECTunnelBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py index 5015126da33..1b6171df8e7 100644 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py +++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py @@ -21,7 +21,7 @@ class IPSECTunnelCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" cloudflare_endpoint: Required[str] diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py index c2c4ae714f2..1066fa603d1 100644 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py +++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_psk_generate_params.py @@ -8,7 +8,7 @@ class IPSECTunnelPSKGenerateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[object] diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py index 1c7b84e6b4e..459e55c76ed 100644 --- a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py +++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py @@ -21,7 +21,7 @@ class IPSECTunnelUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" cloudflare_endpoint: Required[str] diff --git a/src/cloudflare/types/magic_transit/pcap_create_params.py b/src/cloudflare/types/magic_transit/pcap_create_params.py index b0b1a4b7424..9f45d7a7416 100644 --- a/src/cloudflare/types/magic_transit/pcap_create_params.py +++ b/src/cloudflare/types/magic_transit/pcap_create_params.py @@ -13,7 +13,7 @@ class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" packet_limit: Required[float] @@ -44,7 +44,7 @@ class MagicVisibilityPCAPsPCAPsRequestSimple(TypedDict, total=False): class MagicVisibilityPCAPsPCAPsRequestFull(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" colo_name: Required[str] diff --git a/src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py b/src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py index 564013fafe4..88697315303 100644 --- a/src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py +++ b/src/cloudflare/types/magic_transit/pcaps/ownership_create_params.py @@ -8,7 +8,7 @@ class OwnershipCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" destination_conf: Required[str] diff --git a/src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py b/src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py index f25d1516f08..9e8b16ef326 100644 --- a/src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py +++ b/src/cloudflare/types/magic_transit/pcaps/ownership_validate_params.py @@ -8,7 +8,7 @@ class OwnershipValidateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" destination_conf: Required[str] diff --git a/src/cloudflare/types/magic_transit/route_bulk_update_params.py b/src/cloudflare/types/magic_transit/route_bulk_update_params.py index 49008db4b0d..9fe9f18041d 100644 --- a/src/cloudflare/types/magic_transit/route_bulk_update_params.py +++ b/src/cloudflare/types/magic_transit/route_bulk_update_params.py @@ -11,7 +11,7 @@ class RouteBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" routes: Required[Iterable[Route]] diff --git a/src/cloudflare/types/magic_transit/route_create_params.py b/src/cloudflare/types/magic_transit/route_create_params.py index 60f436eafa5..44f903dc099 100644 --- a/src/cloudflare/types/magic_transit/route_create_params.py +++ b/src/cloudflare/types/magic_transit/route_create_params.py @@ -10,7 +10,7 @@ class RouteCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" nexthop: Required[str] diff --git a/src/cloudflare/types/magic_transit/route_update_params.py b/src/cloudflare/types/magic_transit/route_update_params.py index a54ecd0d8e9..14d10ad42c0 100644 --- a/src/cloudflare/types/magic_transit/route_update_params.py +++ b/src/cloudflare/types/magic_transit/route_update_params.py @@ -10,7 +10,7 @@ class RouteUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" nexthop: Required[str] diff --git a/src/cloudflare/types/magic_transit/site_create_params.py b/src/cloudflare/types/magic_transit/site_create_params.py index 570a4a6475a..70a64bc5406 100644 --- a/src/cloudflare/types/magic_transit/site_create_params.py +++ b/src/cloudflare/types/magic_transit/site_create_params.py @@ -10,7 +10,7 @@ class SiteCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" name: Required[str] diff --git a/src/cloudflare/types/magic_transit/site_edit_params.py b/src/cloudflare/types/magic_transit/site_edit_params.py index d7f5db5a9f2..eef65820c0b 100644 --- a/src/cloudflare/types/magic_transit/site_edit_params.py +++ b/src/cloudflare/types/magic_transit/site_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .site_location_param import SiteLocationParam @@ -10,7 +10,7 @@ class SiteEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" connector_id: str diff --git a/src/cloudflare/types/magic_transit/site_list_params.py b/src/cloudflare/types/magic_transit/site_list_params.py index 88f6947310d..d446c2a2809 100644 --- a/src/cloudflare/types/magic_transit/site_list_params.py +++ b/src/cloudflare/types/magic_transit/site_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SiteListParams"] class SiteListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" connectorid: str diff --git a/src/cloudflare/types/magic_transit/site_update_params.py b/src/cloudflare/types/magic_transit/site_update_params.py index 27aab123ac6..4568612636c 100644 --- a/src/cloudflare/types/magic_transit/site_update_params.py +++ b/src/cloudflare/types/magic_transit/site_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .site_location_param import SiteLocationParam @@ -10,7 +10,7 @@ class SiteUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" connector_id: str diff --git a/src/cloudflare/types/magic_transit/sites/acl_create_params.py b/src/cloudflare/types/magic_transit/sites/acl_create_params.py index 7b57a3accb3..c193c6d556c 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_create_params.py @@ -12,7 +12,7 @@ class ACLCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" lan_1: Required[ACLConfigurationParam] diff --git a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py index 0e7046c1a39..3280bbe53b2 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_edit_params.py @@ -12,7 +12,7 @@ class ACLEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py index 0c7c3e79660..250ed85c126 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_update_params.py @@ -12,7 +12,7 @@ class ACLUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/magic_transit/sites/lan_create_params.py b/src/cloudflare/types/magic_transit/sites/lan_create_params.py index 5cc86ab3876..ba7ea87f1a4 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .nat_param import NatParam from .routed_subnet_param import RoutedSubnetParam @@ -13,7 +13,7 @@ class LANCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" bond_id: int diff --git a/src/cloudflare/types/magic_transit/sites/lan_edit_params.py b/src/cloudflare/types/magic_transit/sites/lan_edit_params.py index cbbe6120380..36fd58040bf 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_edit_params.py @@ -13,7 +13,7 @@ class LANEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/magic_transit/sites/lan_update_params.py b/src/cloudflare/types/magic_transit/sites/lan_update_params.py index abd0bf1b830..db47e847eee 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_update_params.py @@ -13,7 +13,7 @@ class LANUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/magic_transit/sites/wan_create_params.py b/src/cloudflare/types/magic_transit/sites/wan_create_params.py index c720b18281e..3538b8411e3 100644 --- a/src/cloudflare/types/magic_transit/sites/wan_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/wan_create_params.py @@ -10,7 +10,7 @@ class WANCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" physport: Required[int] diff --git a/src/cloudflare/types/magic_transit/sites/wan_edit_params.py b/src/cloudflare/types/magic_transit/sites/wan_edit_params.py index ed2e47d3c26..33459da7830 100644 --- a/src/cloudflare/types/magic_transit/sites/wan_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/wan_edit_params.py @@ -10,7 +10,7 @@ class WANEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/magic_transit/sites/wan_update_params.py b/src/cloudflare/types/magic_transit/sites/wan_update_params.py index 885d9c28b7e..55e62875c5d 100644 --- a/src/cloudflare/types/magic_transit/sites/wan_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/wan_update_params.py @@ -10,7 +10,7 @@ class WANUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" site_id: Required[str] diff --git a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py index 717369b3916..572146cec03 100644 --- a/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py +++ b/src/cloudflare/types/managed_transforms/managed_transform_edit_params.py @@ -9,7 +9,7 @@ class ManagedTransformEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """The unique ID of the zone.""" managed_request_headers: Required[Iterable[ManagedRequestHeader]] diff --git a/src/cloudflare/types/mtls_certificates/mtls_certificate_create_params.py b/src/cloudflare/types/mtls_certificates/mtls_certificate_create_params.py index e8937505ac2..e5e955f7641 100644 --- a/src/cloudflare/types/mtls_certificates/mtls_certificate_create_params.py +++ b/src/cloudflare/types/mtls_certificates/mtls_certificate_create_params.py @@ -8,7 +8,7 @@ class MTLSCertificateCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" ca: Required[bool] diff --git a/src/cloudflare/types/mtls_certificates/mtls_certificate_list_params.py b/src/cloudflare/types/mtls_certificates/mtls_certificate_list_params.py index 9d301e91d9c..68fe23c34a9 100644 --- a/src/cloudflare/types/mtls_certificates/mtls_certificate_list_params.py +++ b/src/cloudflare/types/mtls_certificates/mtls_certificate_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MTLSCertificateListParams"] class MTLSCertificateListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" type: List[Literal["custom", "gateway_managed", "access_managed"]] diff --git a/src/cloudflare/types/network_interconnects/cni_create_params.py b/src/cloudflare/types/network_interconnects/cni_create_params.py index c8c482501da..22518f602cf 100644 --- a/src/cloudflare/types/network_interconnects/cni_create_params.py +++ b/src/cloudflare/types/network_interconnects/cni_create_params.py @@ -11,7 +11,7 @@ class CNICreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" account: Required[str] diff --git a/src/cloudflare/types/network_interconnects/cni_list_params.py b/src/cloudflare/types/network_interconnects/cni_list_params.py index 680513eca8d..105f62d5031 100644 --- a/src/cloudflare/types/network_interconnects/cni_list_params.py +++ b/src/cloudflare/types/network_interconnects/cni_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CNIListParams"] class CNIListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" cursor: Optional[int] diff --git a/src/cloudflare/types/network_interconnects/cni_update_params.py b/src/cloudflare/types/network_interconnects/cni_update_params.py index b593a346287..bddc5d5e666 100644 --- a/src/cloudflare/types/network_interconnects/cni_update_params.py +++ b/src/cloudflare/types/network_interconnects/cni_update_params.py @@ -11,7 +11,7 @@ class CNIUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" id: Required[str] diff --git a/src/cloudflare/types/network_interconnects/interconnect_create_params.py b/src/cloudflare/types/network_interconnects/interconnect_create_params.py index 89013b9cae7..c62824f18c9 100644 --- a/src/cloudflare/types/network_interconnects/interconnect_create_params.py +++ b/src/cloudflare/types/network_interconnects/interconnect_create_params.py @@ -9,7 +9,7 @@ class NscInterconnectCreatePhysicalBody(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" account: Required[str] @@ -22,7 +22,7 @@ class NscInterconnectCreatePhysicalBody(TypedDict, total=False): class NscInterconnectCreateGcpPartnerBody(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" account: Required[str] diff --git a/src/cloudflare/types/network_interconnects/interconnect_list_params.py b/src/cloudflare/types/network_interconnects/interconnect_list_params.py index 967840ff3d5..1b60b5ce038 100644 --- a/src/cloudflare/types/network_interconnects/interconnect_list_params.py +++ b/src/cloudflare/types/network_interconnects/interconnect_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["InterconnectListParams"] class InterconnectListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" cursor: Optional[int] diff --git a/src/cloudflare/types/network_interconnects/setting_update_params.py b/src/cloudflare/types/network_interconnects/setting_update_params.py index e54768163cb..f548ca5b4d7 100644 --- a/src/cloudflare/types/network_interconnects/setting_update_params.py +++ b/src/cloudflare/types/network_interconnects/setting_update_params.py @@ -3,12 +3,12 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingUpdateParams"] class SettingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] default_asn: Optional[int] diff --git a/src/cloudflare/types/network_interconnects/slot_list_params.py b/src/cloudflare/types/network_interconnects/slot_list_params.py index ff462ef0bb7..a788e11fb1e 100644 --- a/src/cloudflare/types/network_interconnects/slot_list_params.py +++ b/src/cloudflare/types/network_interconnects/slot_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SlotListParams"] class SlotListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Customer account tag""" address_contains: Optional[str] diff --git a/src/cloudflare/types/organizations/__init__.py b/src/cloudflare/types/organizations/__init__.py index af7b2fd5f68..5a572cf4049 100644 --- a/src/cloudflare/types/organizations/__init__.py +++ b/src/cloudflare/types/organizations/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .organization import Organization as Organization -from .organization_profile import OrganizationProfile as OrganizationProfile from .organization_list_params import OrganizationListParams as OrganizationListParams from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams diff --git a/src/cloudflare/types/organizations/logs/__init__.py b/src/cloudflare/types/organizations/logs/__init__.py new file mode 100644 index 00000000000..4db884733b2 --- /dev/null +++ b/src/cloudflare/types/organizations/logs/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .audit_list_params import AuditListParams as AuditListParams +from .audit_list_response import AuditListResponse as AuditListResponse diff --git a/src/cloudflare/types/organizations/logs/audit_list_params.py b/src/cloudflare/types/organizations/logs/audit_list_params.py new file mode 100644 index 00000000000..d43fdf33173 --- /dev/null +++ b/src/cloudflare/types/organizations/logs/audit_list_params.py @@ -0,0 +1,336 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable +from datetime import date +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = [ + "AuditListParams", + "ID", + "ActionResult", + "ActionType", + "ActorContext", + "ActorEmail", + "ActorID", + "ActorIPAddress", + "ActorTokenID", + "ActorTokenName", + "ActorType", + "RawCfRayID", + "RawMethod", + "RawStatusCode", + "RawURI", + "ResourceID", + "ResourceProduct", + "ResourceScope", + "ResourceType", +] + + +class AuditListParams(TypedDict, total=False): + before: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """Limits the returned results to logs older than the specified date. + + This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + timestamp that conforms to RFC3339. + """ + + since: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + """Limits the returned results to logs newer than the specified date. + + This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + timestamp that conforms to RFC3339. + """ + + id: ID + + action_result: ActionResult + + action_type: ActionType + + actor_context: ActorContext + + actor_email: ActorEmail + + actor_id: ActorID + + actor_ip_address: ActorIPAddress + + actor_token_id: ActorTokenID + + actor_token_name: ActorTokenName + + actor_type: ActorType + + cursor: str + """The cursor is an opaque token used to paginate through large sets of records. + + It indicates the position from which to continue when requesting the next set of + records. A valid cursor value can be obtained from the cursor object in the + result_info structure of a previous response. + """ + + direction: Literal["desc", "asc"] + """Sets sorting order.""" + + limit: float + """The number limits the objects to return. + + The cursor attribute may be used to iterate over the next batch of objects if + there are more than the limit. + """ + + raw_cf_rayid: Annotated[RawCfRayID, PropertyInfo(alias="raw_cf_ray_id")] + + raw_method: RawMethod + + raw_status_code: RawStatusCode + + raw_uri: RawURI + + resource_id: ResourceID + + resource_product: ResourceProduct + + resource_scope: ResourceScope + + resource_type: ResourceType + + +_IDReservedKeywords = TypedDict( + "_IDReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ID(_IDReservedKeywords, total=False): + pass + + +_ActionResultReservedKeywords = TypedDict( + "_ActionResultReservedKeywords", + { + "not": List[Literal["success", "failure"]], + }, + total=False, +) + + +class ActionResult(_ActionResultReservedKeywords, total=False): + pass + + +_ActionTypeReservedKeywords = TypedDict( + "_ActionTypeReservedKeywords", + { + "not": List[Literal["create", "delete", "view", "update"]], + }, + total=False, +) + + +class ActionType(_ActionTypeReservedKeywords, total=False): + pass + + +_ActorContextReservedKeywords = TypedDict( + "_ActorContextReservedKeywords", + { + "not": List[Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"]], + }, + total=False, +) + + +class ActorContext(_ActorContextReservedKeywords, total=False): + pass + + +_ActorEmailReservedKeywords = TypedDict( + "_ActorEmailReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ActorEmail(_ActorEmailReservedKeywords, total=False): + pass + + +_ActorIDReservedKeywords = TypedDict( + "_ActorIDReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ActorID(_ActorIDReservedKeywords, total=False): + pass + + +_ActorIPAddressReservedKeywords = TypedDict( + "_ActorIPAddressReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ActorIPAddress(_ActorIPAddressReservedKeywords, total=False): + pass + + +_ActorTokenIDReservedKeywords = TypedDict( + "_ActorTokenIDReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ActorTokenID(_ActorTokenIDReservedKeywords, total=False): + pass + + +_ActorTokenNameReservedKeywords = TypedDict( + "_ActorTokenNameReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ActorTokenName(_ActorTokenNameReservedKeywords, total=False): + pass + + +_ActorTypeReservedKeywords = TypedDict( + "_ActorTypeReservedKeywords", + { + "not": List[Literal["cloudflare_admin", "system", "user"]], + }, + total=False, +) + + +class ActorType(_ActorTypeReservedKeywords, total=False): + pass + + +_RawCfRayIDReservedKeywords = TypedDict( + "_RawCfRayIDReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class RawCfRayID(_RawCfRayIDReservedKeywords, total=False): + pass + + +_RawMethodReservedKeywords = TypedDict( + "_RawMethodReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class RawMethod(_RawMethodReservedKeywords, total=False): + pass + + +_RawStatusCodeReservedKeywords = TypedDict( + "_RawStatusCodeReservedKeywords", + { + "not": Iterable[int], + }, + total=False, +) + + +class RawStatusCode(_RawStatusCodeReservedKeywords, total=False): + pass + + +_RawURIReservedKeywords = TypedDict( + "_RawURIReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class RawURI(_RawURIReservedKeywords, total=False): + pass + + +_ResourceIDReservedKeywords = TypedDict( + "_ResourceIDReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ResourceID(_ResourceIDReservedKeywords, total=False): + pass + + +_ResourceProductReservedKeywords = TypedDict( + "_ResourceProductReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ResourceProduct(_ResourceProductReservedKeywords, total=False): + pass + + +_ResourceScopeReservedKeywords = TypedDict( + "_ResourceScopeReservedKeywords", + { + "not": List[Literal["organizations"]], + }, + total=False, +) + + +class ResourceScope(_ResourceScopeReservedKeywords, total=False): + pass + + +_ResourceTypeReservedKeywords = TypedDict( + "_ResourceTypeReservedKeywords", + { + "not": SequenceNotStr[str], + }, + total=False, +) + + +class ResourceType(_ResourceTypeReservedKeywords, total=False): + pass diff --git a/src/cloudflare/types/organizations/logs/audit_list_response.py b/src/cloudflare/types/organizations/logs/audit_list_response.py new file mode 100644 index 00000000000..f842758b37b --- /dev/null +++ b/src/cloudflare/types/organizations/logs/audit_list_response.py @@ -0,0 +1,120 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["AuditListResponse", "Action", "Actor", "Organization", "Raw", "Resource"] + + +class Action(BaseModel): + """Provides information about the action performed.""" + + description: Optional[str] = None + """A short description of the action performed.""" + + result: Optional[str] = None + """The result of the action, indicating success or failure.""" + + time: Optional[datetime] = None + """A timestamp indicating when the action was logged.""" + + type: Optional[str] = None + """A short string that describes the action that was performed.""" + + +class Actor(BaseModel): + """Provides details about the actor who performed the action.""" + + id: Optional[str] = None + """The ID of the actor who performed the action. + + If a user performed the action, this will be their User ID. + """ + + context: Optional[Literal["api_key", "api_token", "dash", "oauth", "origin_ca_key"]] = None + + email: Optional[str] = None + """The email of the actor who performed the action.""" + + ip_address: Optional[str] = None + """The IP address of the request that performed the action.""" + + token_id: Optional[str] = None + """The API token ID when the actor context is an api_token or oauth.""" + + token_name: Optional[str] = None + """The API token name when the actor context is an api_token or oauth.""" + + type: Optional[Literal["cloudflare_admin", "system", "user"]] = None + """The type of actor.""" + + +class Organization(BaseModel): + """Contains organization related information.""" + + id: Optional[str] = None + """A unique identifier for the organization.""" + + +class Raw(BaseModel): + """Provides raw information about the request and response.""" + + cf_rayid: Optional[str] = FieldInfo(alias="cf_ray_id", default=None) + """The Cloudflare Ray ID for the request.""" + + method: Optional[str] = None + """The HTTP method of the request.""" + + status_code: Optional[int] = None + """The HTTP response status code returned by the API.""" + + uri: Optional[str] = None + """The URI of the request.""" + + user_agent: Optional[str] = None + """The client's user agent string sent with the request.""" + + +class Resource(BaseModel): + """Provides details about the affected resource.""" + + id: Optional[str] = None + """The unique identifier for the affected resource.""" + + product: Optional[str] = None + """The Cloudflare product associated with the resource.""" + + request: Optional[object] = None + + response: Optional[object] = None + + scope: Optional[object] = None + """The scope of the resource.""" + + type: Optional[str] = None + """The type of the resource.""" + + +class AuditListResponse(BaseModel): + id: Optional[str] = None + """A unique identifier for the audit log entry.""" + + action: Optional[Action] = None + """Provides information about the action performed.""" + + actor: Optional[Actor] = None + """Provides details about the actor who performed the action.""" + + organization: Optional[Organization] = None + """Contains organization related information.""" + + raw: Optional[Raw] = None + """Provides raw information about the request and response.""" + + resource: Optional[Resource] = None + """Provides details about the affected resource.""" diff --git a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_params.py b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_params.py index f22ea0b9a8d..bee5dfc4afb 100644 --- a/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_params.py +++ b/src/cloudflare/types/origin_post_quantum_encryption/origin_post_quantum_encryption_update_params.py @@ -8,7 +8,7 @@ class OriginPostQuantumEncryptionUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" value: Required[Literal["preferred", "supported", "off"]] diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_params.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_params.py index 8b08618c9ce..b319cad88e3 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_params.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_params.py @@ -8,7 +8,7 @@ class HostnameCertificateCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_update_params.py b/src/cloudflare/types/origin_tls_client_auth/hostname_update_params.py index 04efca1ba54..60eaf149a18 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_update_params.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_update_params.py @@ -9,7 +9,7 @@ class HostnameUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" config: Required[Iterable[Config]] diff --git a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_params.py b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_params.py index d17edc735a1..09889f17e00 100644 --- a/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_params.py +++ b/src/cloudflare/types/origin_tls_client_auth/origin_tls_client_auth_create_params.py @@ -8,7 +8,7 @@ class OriginTLSClientAuthCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/origin_tls_client_auth/setting_update_params.py b/src/cloudflare/types/origin_tls_client_auth/setting_update_params.py index a3872f7a0f1..2c61f7f44ca 100644 --- a/src/cloudflare/types/origin_tls_client_auth/setting_update_params.py +++ b/src/cloudflare/types/origin_tls_client_auth/setting_update_params.py @@ -8,7 +8,7 @@ class SettingUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: Required[bool] diff --git a/src/cloudflare/types/origin_tls_client_auth/zone_certificate_create_params.py b/src/cloudflare/types/origin_tls_client_auth/zone_certificate_create_params.py index 91bf7fc931f..ac2c5b87bd6 100644 --- a/src/cloudflare/types/origin_tls_client_auth/zone_certificate_create_params.py +++ b/src/cloudflare/types/origin_tls_client_auth/zone_certificate_create_params.py @@ -8,7 +8,7 @@ class ZoneCertificateCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate: Required[str] diff --git a/src/cloudflare/types/page_rules/page_rule_create_params.py b/src/cloudflare/types/page_rules/page_rule_create_params.py index dcbd49893d6..2450668fc39 100644 --- a/src/cloudflare/types/page_rules/page_rule_create_params.py +++ b/src/cloudflare/types/page_rules/page_rule_create_params.py @@ -56,7 +56,7 @@ class PageRuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Required[Iterable[Action]] diff --git a/src/cloudflare/types/page_rules/page_rule_edit_params.py b/src/cloudflare/types/page_rules/page_rule_edit_params.py index 913ad68297a..ceb4965fb66 100644 --- a/src/cloudflare/types/page_rules/page_rule_edit_params.py +++ b/src/cloudflare/types/page_rules/page_rule_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Union, Iterable -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict from ..._types import SequenceNotStr from .target_param import TargetParam @@ -56,7 +56,7 @@ class PageRuleEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Iterable[Action] diff --git a/src/cloudflare/types/page_rules/page_rule_list_params.py b/src/cloudflare/types/page_rules/page_rule_list_params.py index fdf632d6a24..2e00e0732b7 100644 --- a/src/cloudflare/types/page_rules/page_rule_list_params.py +++ b/src/cloudflare/types/page_rules/page_rule_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PageRuleListParams"] class PageRuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/page_rules/page_rule_update_params.py b/src/cloudflare/types/page_rules/page_rule_update_params.py index e8ba92fefd4..baf13f4b982 100644 --- a/src/cloudflare/types/page_rules/page_rule_update_params.py +++ b/src/cloudflare/types/page_rules/page_rule_update_params.py @@ -56,7 +56,7 @@ class PageRuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" actions: Required[Iterable[Action]] diff --git a/src/cloudflare/types/page_shield/connection_list_params.py b/src/cloudflare/types/page_shield/connection_list_params.py index 0cec56bb406..7da26a46573 100644 --- a/src/cloudflare/types/page_shield/connection_list_params.py +++ b/src/cloudflare/types/page_shield/connection_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ConnectionListParams"] class ConnectionListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/page_shield/cookie_list_params.py b/src/cloudflare/types/page_shield/cookie_list_params.py index f4046b75db4..2f1c508612b 100644 --- a/src/cloudflare/types/page_shield/cookie_list_params.py +++ b/src/cloudflare/types/page_shield/cookie_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CookieListParams"] class CookieListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/page_shield/page_shield_update_params.py b/src/cloudflare/types/page_shield/page_shield_update_params.py index 3c427f1d5fd..123ba5bb1e0 100644 --- a/src/cloudflare/types/page_shield/page_shield_update_params.py +++ b/src/cloudflare/types/page_shield/page_shield_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PageShieldUpdateParams"] class PageShieldUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" enabled: bool diff --git a/src/cloudflare/types/page_shield/policy_create_params.py b/src/cloudflare/types/page_shield/policy_create_params.py index 6da286a3d66..9ff8c1bd62f 100644 --- a/src/cloudflare/types/page_shield/policy_create_params.py +++ b/src/cloudflare/types/page_shield/policy_create_params.py @@ -8,7 +8,7 @@ class PolicyCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" action: Required[Literal["allow", "log", "add_reporting_directives"]] diff --git a/src/cloudflare/types/page_shield/policy_update_params.py b/src/cloudflare/types/page_shield/policy_update_params.py index 82162f22f60..c0e6e0f9a2c 100644 --- a/src/cloudflare/types/page_shield/policy_update_params.py +++ b/src/cloudflare/types/page_shield/policy_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PolicyUpdateParams"] class PolicyUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" action: Literal["allow", "log", "add_reporting_directives"] diff --git a/src/cloudflare/types/page_shield/script_list_params.py b/src/cloudflare/types/page_shield/script_list_params.py index 60f2b9739a7..fea47abd515 100644 --- a/src/cloudflare/types/page_shield/script_list_params.py +++ b/src/cloudflare/types/page_shield/script_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScriptListParams"] class ScriptListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/pages/project_create_params.py b/src/cloudflare/types/pages/project_create_params.py index 1de680bebd3..321845dc2af 100644 --- a/src/cloudflare/types/pages/project_create_params.py +++ b/src/cloudflare/types/pages/project_create_params.py @@ -53,7 +53,7 @@ class ProjectCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/pages/project_edit_params.py b/src/cloudflare/types/pages/project_edit_params.py index 6ecbc903bbf..793b61adbe0 100644 --- a/src/cloudflare/types/pages/project_edit_params.py +++ b/src/cloudflare/types/pages/project_edit_params.py @@ -53,7 +53,7 @@ class ProjectEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" build_config: BuildConfig diff --git a/src/cloudflare/types/pages/project_list_params.py b/src/cloudflare/types/pages/project_list_params.py index 55aa78571b1..a3331078193 100644 --- a/src/cloudflare/types/pages/project_list_params.py +++ b/src/cloudflare/types/pages/project_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ProjectListParams"] class ProjectListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/pages/projects/deployment_create_params.py b/src/cloudflare/types/pages/projects/deployment_create_params.py index 2ae80c3e641..c9c36ee79d9 100644 --- a/src/cloudflare/types/pages/projects/deployment_create_params.py +++ b/src/cloudflare/types/pages/projects/deployment_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._types import FileTypes from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class DeploymentCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" _headers: FileTypes diff --git a/src/cloudflare/types/pages/projects/deployment_delete_params.py b/src/cloudflare/types/pages/projects/deployment_delete_params.py index 103a6fc3de8..e6cc0ec2b7d 100644 --- a/src/cloudflare/types/pages/projects/deployment_delete_params.py +++ b/src/cloudflare/types/pages/projects/deployment_delete_params.py @@ -8,7 +8,7 @@ class DeploymentDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" project_name: Required[str] diff --git a/src/cloudflare/types/pages/projects/deployment_list_params.py b/src/cloudflare/types/pages/projects/deployment_list_params.py index 824374f2a3e..596f1462e6b 100644 --- a/src/cloudflare/types/pages/projects/deployment_list_params.py +++ b/src/cloudflare/types/pages/projects/deployment_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["DeploymentListParams"] class DeploymentListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" env: Literal["production", "preview"] diff --git a/src/cloudflare/types/pages/projects/domain_create_params.py b/src/cloudflare/types/pages/projects/domain_create_params.py index c57c9b58680..8e445ce2a62 100644 --- a/src/cloudflare/types/pages/projects/domain_create_params.py +++ b/src/cloudflare/types/pages/projects/domain_create_params.py @@ -8,7 +8,7 @@ class DomainCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/queues/consumer_create_params.py b/src/cloudflare/types/queues/consumer_create_params.py index 421964025b1..7aa340053a2 100644 --- a/src/cloudflare/types/queues/consumer_create_params.py +++ b/src/cloudflare/types/queues/consumer_create_params.py @@ -15,7 +15,7 @@ class MqWorkerConsumerRequest(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" script_name: Required[str] @@ -55,7 +55,7 @@ class MqWorkerConsumerRequestSettings(TypedDict, total=False): class MqHTTPConsumerRequest(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" type: Required[Literal["http_pull"]] diff --git a/src/cloudflare/types/queues/consumer_update_params.py b/src/cloudflare/types/queues/consumer_update_params.py index 0c92b9d848e..6be97557103 100644 --- a/src/cloudflare/types/queues/consumer_update_params.py +++ b/src/cloudflare/types/queues/consumer_update_params.py @@ -15,7 +15,7 @@ class MqWorkerConsumerRequest(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" queue_id: Required[str] @@ -58,7 +58,7 @@ class MqWorkerConsumerRequestSettings(TypedDict, total=False): class MqHTTPConsumerRequest(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" queue_id: Required[str] diff --git a/src/cloudflare/types/queues/message_ack_params.py b/src/cloudflare/types/queues/message_ack_params.py index 442eab45027..144cfac1f2f 100644 --- a/src/cloudflare/types/queues/message_ack_params.py +++ b/src/cloudflare/types/queues/message_ack_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MessageAckParams", "Ack", "Retry"] class MessageAckParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" acks: Iterable[Ack] diff --git a/src/cloudflare/types/queues/message_bulk_push_params.py b/src/cloudflare/types/queues/message_bulk_push_params.py index 064b6dc9e5d..8057dcb6740 100644 --- a/src/cloudflare/types/queues/message_bulk_push_params.py +++ b/src/cloudflare/types/queues/message_bulk_push_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = ["MessageBulkPushParams", "Message", "MessageMqQueueMessageText", "MessageMqQueueMessageJson"] class MessageBulkPushParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" delay_seconds: float diff --git a/src/cloudflare/types/queues/message_pull_params.py b/src/cloudflare/types/queues/message_pull_params.py index b157b065907..2613f621005 100644 --- a/src/cloudflare/types/queues/message_pull_params.py +++ b/src/cloudflare/types/queues/message_pull_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["MessagePullParams"] class MessagePullParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" batch_size: float diff --git a/src/cloudflare/types/queues/message_push_params.py b/src/cloudflare/types/queues/message_push_params.py index f3af31dd53b..d01605820d9 100644 --- a/src/cloudflare/types/queues/message_push_params.py +++ b/src/cloudflare/types/queues/message_push_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict __all__ = ["MessagePushParams", "MqQueueMessageText", "MqQueueMessageJson"] class MqQueueMessageText(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" body: str @@ -24,7 +24,7 @@ class MqQueueMessageText(TypedDict, total=False): class MqQueueMessageJson(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" body: object diff --git a/src/cloudflare/types/queues/purge_start_params.py b/src/cloudflare/types/queues/purge_start_params.py index 14c81777756..c6f16dc04c0 100644 --- a/src/cloudflare/types/queues/purge_start_params.py +++ b/src/cloudflare/types/queues/purge_start_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PurgeStartParams"] class PurgeStartParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" delete_messages_permanently: bool diff --git a/src/cloudflare/types/queues/queue_create_params.py b/src/cloudflare/types/queues/queue_create_params.py index a60768d4fd5..e14f226a015 100644 --- a/src/cloudflare/types/queues/queue_create_params.py +++ b/src/cloudflare/types/queues/queue_create_params.py @@ -8,7 +8,7 @@ class QueueCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" queue_name: Required[str] diff --git a/src/cloudflare/types/queues/queue_edit_params.py b/src/cloudflare/types/queues/queue_edit_params.py index c1875aab60d..5b99c17dda8 100644 --- a/src/cloudflare/types/queues/queue_edit_params.py +++ b/src/cloudflare/types/queues/queue_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["QueueEditParams", "Settings"] class QueueEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" queue_name: str diff --git a/src/cloudflare/types/queues/queue_update_params.py b/src/cloudflare/types/queues/queue_update_params.py index a2e42f28364..9b53025f044 100644 --- a/src/cloudflare/types/queues/queue_update_params.py +++ b/src/cloudflare/types/queues/queue_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["QueueUpdateParams", "Settings"] class QueueUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" queue_name: str diff --git a/src/cloudflare/types/queues/subscription_create_params.py b/src/cloudflare/types/queues/subscription_create_params.py index 292a7008012..5540bee2746 100644 --- a/src/cloudflare/types/queues/subscription_create_params.py +++ b/src/cloudflare/types/queues/subscription_create_params.py @@ -23,7 +23,7 @@ class SubscriptionCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" destination: Destination diff --git a/src/cloudflare/types/queues/subscription_list_params.py b/src/cloudflare/types/queues/subscription_list_params.py index 6cb5f715ad3..362a6d63b93 100644 --- a/src/cloudflare/types/queues/subscription_list_params.py +++ b/src/cloudflare/types/queues/subscription_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SubscriptionListParams"] class SubscriptionListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/queues/subscription_update_params.py b/src/cloudflare/types/queues/subscription_update_params.py index 0c6962be86f..e1b9a00c85e 100644 --- a/src/cloudflare/types/queues/subscription_update_params.py +++ b/src/cloudflare/types/queues/subscription_update_params.py @@ -10,7 +10,7 @@ class SubscriptionUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """A Resource identifier.""" destination: Destination diff --git a/src/cloudflare/types/r2/bucket_create_params.py b/src/cloudflare/types/r2/bucket_create_params.py index aee6da847d2..ca5f063a071 100644 --- a/src/cloudflare/types/r2/bucket_create_params.py +++ b/src/cloudflare/types/r2/bucket_create_params.py @@ -10,7 +10,7 @@ class BucketCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" name: Required[str] diff --git a/src/cloudflare/types/r2/bucket_list_params.py b/src/cloudflare/types/r2/bucket_list_params.py index aaeb3b98d2a..6370982092d 100644 --- a/src/cloudflare/types/r2/bucket_list_params.py +++ b/src/cloudflare/types/r2/bucket_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class BucketListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" cursor: str diff --git a/src/cloudflare/types/r2/buckets/cors_update_params.py b/src/cloudflare/types/r2/buckets/cors_update_params.py index 1856cd3d9b8..7525dd3ce7d 100644 --- a/src/cloudflare/types/r2/buckets/cors_update_params.py +++ b/src/cloudflare/types/r2/buckets/cors_update_params.py @@ -12,7 +12,7 @@ class CORSUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" rules: Iterable[Rule] diff --git a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py index 11c695971bf..9c66d7810dd 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_create_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_create_params.py @@ -11,7 +11,7 @@ class CustomCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" domain: Required[str] diff --git a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py index 7f7de4b2167..bf25374a084 100644 --- a/src/cloudflare/types/r2/buckets/domains/custom_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/custom_update_params.py @@ -11,7 +11,7 @@ class CustomUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" bucket_name: Required[str] diff --git a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py index 8274a962f55..3c6275af635 100644 --- a/src/cloudflare/types/r2/buckets/domains/managed_update_params.py +++ b/src/cloudflare/types/r2/buckets/domains/managed_update_params.py @@ -10,7 +10,7 @@ class ManagedUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" enabled: Required[bool] diff --git a/src/cloudflare/types/r2/buckets/event_notification_update_params.py b/src/cloudflare/types/r2/buckets/event_notification_update_params.py index b8ddb17748b..c94ddbada0f 100644 --- a/src/cloudflare/types/r2/buckets/event_notification_update_params.py +++ b/src/cloudflare/types/r2/buckets/event_notification_update_params.py @@ -11,7 +11,7 @@ class EventNotificationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" bucket_name: Required[str] diff --git a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py index 67dff10c356..abdbb29abce 100644 --- a/src/cloudflare/types/r2/buckets/lifecycle_update_params.py +++ b/src/cloudflare/types/r2/buckets/lifecycle_update_params.py @@ -26,7 +26,7 @@ class LifecycleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" rules: Iterable[Rule] diff --git a/src/cloudflare/types/r2/buckets/lock_update_params.py b/src/cloudflare/types/r2/buckets/lock_update_params.py index 20ebce87014..ca8ad5c4e40 100644 --- a/src/cloudflare/types/r2/buckets/lock_update_params.py +++ b/src/cloudflare/types/r2/buckets/lock_update_params.py @@ -19,7 +19,7 @@ class LockUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" rules: Iterable[Rule] diff --git a/src/cloudflare/types/r2/buckets/sippy_update_params.py b/src/cloudflare/types/r2/buckets/sippy_update_params.py index c61abc13df2..84ceaa1f875 100644 --- a/src/cloudflare/types/r2/buckets/sippy_update_params.py +++ b/src/cloudflare/types/r2/buckets/sippy_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import Literal, Annotated, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .provider import Provider from ...._utils import PropertyInfo @@ -23,7 +23,7 @@ class R2EnableSippyAws(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" destination: R2EnableSippyAwsDestination @@ -81,7 +81,7 @@ class R2EnableSippyAwsSource(TypedDict, total=False): class R2EnableSippyGcs(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" destination: R2EnableSippyGcsDestination @@ -136,7 +136,7 @@ class R2EnableSippyGcsSource(TypedDict, total=False): class R2EnableSippyS3(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" destination: R2EnableSippyS3Destination diff --git a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py index 2578aa16575..20b4aef74f0 100644 --- a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py +++ b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py @@ -21,7 +21,7 @@ class R2SlurperS3SourceSchema(TypedDict, total=False): - account_id: str + account_id: Required[str] bucket: Required[str] @@ -45,7 +45,7 @@ class R2SlurperS3SourceSchemaSecret(TypedDict, total=False): class R2SlurperGcsSourceSchema(TypedDict, total=False): - account_id: str + account_id: Required[str] bucket: Required[str] @@ -65,7 +65,7 @@ class R2SlurperGcsSourceSchemaSecret(TypedDict, total=False): class R2SlurperR2SourceSchema(TypedDict, total=False): - account_id: str + account_id: Required[str] bucket: Required[str] diff --git a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_target_params.py b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_target_params.py index 42da84f56fb..90bb1438ff9 100644 --- a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_target_params.py +++ b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_target_params.py @@ -11,7 +11,7 @@ class ConnectivityPrecheckTargetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] bucket: Required[str] diff --git a/src/cloudflare/types/r2/super_slurper/job_create_params.py b/src/cloudflare/types/r2/super_slurper/job_create_params.py index 41ae96d621f..7c1a4c133e6 100644 --- a/src/cloudflare/types/r2/super_slurper/job_create_params.py +++ b/src/cloudflare/types/r2/super_slurper/job_create_params.py @@ -24,7 +24,7 @@ class JobCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] overwrite: bool diff --git a/src/cloudflare/types/r2/super_slurper/job_list_params.py b/src/cloudflare/types/r2/super_slurper/job_list_params.py index 39d471ce4c5..f1b0e487eb0 100644 --- a/src/cloudflare/types/r2/super_slurper/job_list_params.py +++ b/src/cloudflare/types/r2/super_slurper/job_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["JobListParams"] class JobListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] limit: int diff --git a/src/cloudflare/types/r2/super_slurper/jobs/log_list_params.py b/src/cloudflare/types/r2/super_slurper/jobs/log_list_params.py index 09938d1dfc6..ff059a25e3c 100644 --- a/src/cloudflare/types/r2/super_slurper/jobs/log_list_params.py +++ b/src/cloudflare/types/r2/super_slurper/jobs/log_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LogListParams"] class LogListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] limit: int diff --git a/src/cloudflare/types/r2/temporary_credential_create_params.py b/src/cloudflare/types/r2/temporary_credential_create_params.py index 7270f8b8daf..f9b394c5eb6 100644 --- a/src/cloudflare/types/r2/temporary_credential_create_params.py +++ b/src/cloudflare/types/r2/temporary_credential_create_params.py @@ -11,7 +11,7 @@ class TemporaryCredentialCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" bucket: Required[str] diff --git a/src/cloudflare/types/r2_data_catalog/credential_create_params.py b/src/cloudflare/types/r2_data_catalog/credential_create_params.py index 093c7256da0..f4bfaacdb58 100644 --- a/src/cloudflare/types/r2_data_catalog/credential_create_params.py +++ b/src/cloudflare/types/r2_data_catalog/credential_create_params.py @@ -8,7 +8,7 @@ class CredentialCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use this to identify the account.""" token: Required[str] diff --git a/src/cloudflare/types/r2_data_catalog/maintenance_config_update_params.py b/src/cloudflare/types/r2_data_catalog/maintenance_config_update_params.py index be58d4d01b4..ddaed40f425 100644 --- a/src/cloudflare/types/r2_data_catalog/maintenance_config_update_params.py +++ b/src/cloudflare/types/r2_data_catalog/maintenance_config_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["MaintenanceConfigUpdateParams", "Compaction", "SnapshotExpiration"] class MaintenanceConfigUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use this to identify the account.""" compaction: Compaction diff --git a/src/cloudflare/types/r2_data_catalog/namespace_list_params.py b/src/cloudflare/types/r2_data_catalog/namespace_list_params.py index 94552200fdb..fb42c240184 100644 --- a/src/cloudflare/types/r2_data_catalog/namespace_list_params.py +++ b/src/cloudflare/types/r2_data_catalog/namespace_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["NamespaceListParams"] class NamespaceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use this to identify the account.""" page_size: int diff --git a/src/cloudflare/types/r2_data_catalog/namespaces/table_list_params.py b/src/cloudflare/types/r2_data_catalog/namespaces/table_list_params.py index c99368cd54d..e9b5044f6ee 100644 --- a/src/cloudflare/types/r2_data_catalog/namespaces/table_list_params.py +++ b/src/cloudflare/types/r2_data_catalog/namespaces/table_list_params.py @@ -8,7 +8,7 @@ class TableListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use this to identify the account.""" bucket_name: Required[str] diff --git a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_params.py b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_params.py index d508ec30773..020ce8f3b6c 100644 --- a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_params.py +++ b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_params.py @@ -8,7 +8,7 @@ class MaintenanceConfigUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Use this to identify the account.""" bucket_name: Required[str] diff --git a/src/cloudflare/types/rate_limits/rate_limit_create_params.py b/src/cloudflare/types/rate_limits/rate_limit_create_params.py index 66edefc1144..447c2b8b56e 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_create_params.py +++ b/src/cloudflare/types/rate_limits/rate_limit_create_params.py @@ -11,7 +11,7 @@ class RateLimitCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" action: Required[Action] diff --git a/src/cloudflare/types/rate_limits/rate_limit_edit_params.py b/src/cloudflare/types/rate_limits/rate_limit_edit_params.py index f5674cb973e..e91233331b1 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_edit_params.py +++ b/src/cloudflare/types/rate_limits/rate_limit_edit_params.py @@ -11,7 +11,7 @@ class RateLimitEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" action: Required[Action] diff --git a/src/cloudflare/types/rate_limits/rate_limit_list_params.py b/src/cloudflare/types/rate_limits/rate_limit_list_params.py index ce6be251fa4..b4de31ed657 100644 --- a/src/cloudflare/types/rate_limits/rate_limit_list_params.py +++ b/src/cloudflare/types/rate_limits/rate_limit_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RateLimitListParams"] class RateLimitListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Defines an identifier.""" page: float diff --git a/src/cloudflare/types/realtime_kit/active_session_create_poll_params.py b/src/cloudflare/types/realtime_kit/active_session_create_poll_params.py index 9c2aae1a7d1..45cdf76f14e 100644 --- a/src/cloudflare/types/realtime_kit/active_session_create_poll_params.py +++ b/src/cloudflare/types/realtime_kit/active_session_create_poll_params.py @@ -10,7 +10,7 @@ class ActiveSessionCreatePollParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/active_session_kick_participants_params.py b/src/cloudflare/types/realtime_kit/active_session_kick_participants_params.py index 41613784271..afd4df8c824 100644 --- a/src/cloudflare/types/realtime_kit/active_session_kick_participants_params.py +++ b/src/cloudflare/types/realtime_kit/active_session_kick_participants_params.py @@ -10,7 +10,7 @@ class ActiveSessionKickParticipantsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/analytics_get_org_analytics_params.py b/src/cloudflare/types/realtime_kit/analytics_get_org_analytics_params.py index a8f90eb9581..208d478907d 100644 --- a/src/cloudflare/types/realtime_kit/analytics_get_org_analytics_params.py +++ b/src/cloudflare/types/realtime_kit/analytics_get_org_analytics_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["AnalyticsGetOrgAnalyticsParams"] class AnalyticsGetOrgAnalyticsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_date: str diff --git a/src/cloudflare/types/realtime_kit/app_post_params.py b/src/cloudflare/types/realtime_kit/app_post_params.py index 6eab457d44a..1bb8921ab6e 100644 --- a/src/cloudflare/types/realtime_kit/app_post_params.py +++ b/src/cloudflare/types/realtime_kit/app_post_params.py @@ -8,6 +8,6 @@ class AppPostParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/realtime_kit/livestream_create_independent_livestream_params.py b/src/cloudflare/types/realtime_kit/livestream_create_independent_livestream_params.py index 9790add07df..8991dc929c3 100644 --- a/src/cloudflare/types/realtime_kit/livestream_create_independent_livestream_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_create_independent_livestream_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LivestreamCreateIndependentLivestreamParams"] class LivestreamCreateIndependentLivestreamParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: Optional[str] diff --git a/src/cloudflare/types/realtime_kit/livestream_get_all_livestreams_params.py b/src/cloudflare/types/realtime_kit/livestream_get_all_livestreams_params.py index 60fff83f6be..a72b62a0fb2 100644 --- a/src/cloudflare/types/realtime_kit/livestream_get_all_livestreams_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_get_all_livestreams_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class LivestreamGetAllLivestreamsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/realtime_kit/livestream_get_livestream_analytics_complete_params.py b/src/cloudflare/types/realtime_kit/livestream_get_livestream_analytics_complete_params.py index cf606f3b415..132726bf720 100644 --- a/src/cloudflare/types/realtime_kit/livestream_get_livestream_analytics_complete_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_get_livestream_analytics_complete_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class LivestreamGetLivestreamAnalyticsCompleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/realtime_kit/livestream_get_livestream_session_for_livestream_id_params.py b/src/cloudflare/types/realtime_kit/livestream_get_livestream_session_for_livestream_id_params.py index 71c191fe0fc..edf7e5f092a 100644 --- a/src/cloudflare/types/realtime_kit/livestream_get_livestream_session_for_livestream_id_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_get_livestream_session_for_livestream_id_params.py @@ -8,7 +8,7 @@ class LivestreamGetLivestreamSessionForLivestreamIDParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/livestream_get_org_analytics_params.py b/src/cloudflare/types/realtime_kit/livestream_get_org_analytics_params.py index 48a63e37d03..63730dcc0e2 100644 --- a/src/cloudflare/types/realtime_kit/livestream_get_org_analytics_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_get_org_analytics_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LivestreamGetOrgAnalyticsParams"] class LivestreamGetOrgAnalyticsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_date: str diff --git a/src/cloudflare/types/realtime_kit/livestream_start_livestreaming_a_meeting_params.py b/src/cloudflare/types/realtime_kit/livestream_start_livestreaming_a_meeting_params.py index 5239bcd75bb..8a34a6d8d2d 100644 --- a/src/cloudflare/types/realtime_kit/livestream_start_livestreaming_a_meeting_params.py +++ b/src/cloudflare/types/realtime_kit/livestream_start_livestreaming_a_meeting_params.py @@ -9,7 +9,7 @@ class LivestreamStartLivestreamingAMeetingParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_add_participant_params.py b/src/cloudflare/types/realtime_kit/meeting_add_participant_params.py index 361a8f0177d..111b281d294 100644 --- a/src/cloudflare/types/realtime_kit/meeting_add_participant_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_add_participant_params.py @@ -9,7 +9,7 @@ class MeetingAddParticipantParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_create_params.py b/src/cloudflare/types/realtime_kit/meeting_create_params.py index 5890bfc3c6e..7cf8980aa09 100644 --- a/src/cloudflare/types/realtime_kit/meeting_create_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_create_params.py @@ -24,7 +24,7 @@ class MeetingCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" ai_config: AIConfig diff --git a/src/cloudflare/types/realtime_kit/meeting_edit_participant_params.py b/src/cloudflare/types/realtime_kit/meeting_edit_participant_params.py index 49312cbb11d..2b36ce4b14a 100644 --- a/src/cloudflare/types/realtime_kit/meeting_edit_participant_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_edit_participant_params.py @@ -9,7 +9,7 @@ class MeetingEditParticipantParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_get_meeting_by_id_params.py b/src/cloudflare/types/realtime_kit/meeting_get_meeting_by_id_params.py index cc6d647589b..76dc134732c 100644 --- a/src/cloudflare/types/realtime_kit/meeting_get_meeting_by_id_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_get_meeting_by_id_params.py @@ -8,7 +8,7 @@ class MeetingGetMeetingByIDParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_get_meeting_participants_params.py b/src/cloudflare/types/realtime_kit/meeting_get_meeting_participants_params.py index 71224b7690e..a7476985b95 100644 --- a/src/cloudflare/types/realtime_kit/meeting_get_meeting_participants_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_get_meeting_participants_params.py @@ -8,7 +8,7 @@ class MeetingGetMeetingParticipantsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_get_params.py b/src/cloudflare/types/realtime_kit/meeting_get_params.py index 8c8de4b3b39..4cf938f1ed9 100644 --- a/src/cloudflare/types/realtime_kit/meeting_get_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_get_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class MeetingGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/realtime_kit/meeting_replace_meeting_by_id_params.py b/src/cloudflare/types/realtime_kit/meeting_replace_meeting_by_id_params.py index 39c437058f9..ddc84a3ef07 100644 --- a/src/cloudflare/types/realtime_kit/meeting_replace_meeting_by_id_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_replace_meeting_by_id_params.py @@ -24,7 +24,7 @@ class MeetingReplaceMeetingByIDParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/meeting_update_meeting_by_id_params.py b/src/cloudflare/types/realtime_kit/meeting_update_meeting_by_id_params.py index 0667733954d..f58ca68b842 100644 --- a/src/cloudflare/types/realtime_kit/meeting_update_meeting_by_id_params.py +++ b/src/cloudflare/types/realtime_kit/meeting_update_meeting_by_id_params.py @@ -10,7 +10,7 @@ class MeetingUpdateMeetingByIDParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/preset_create_params.py b/src/cloudflare/types/realtime_kit/preset_create_params.py index 5ec2ff20485..23fb7761a88 100644 --- a/src/cloudflare/types/realtime_kit/preset_create_params.py +++ b/src/cloudflare/types/realtime_kit/preset_create_params.py @@ -37,7 +37,7 @@ class PresetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" config: Required[Config] diff --git a/src/cloudflare/types/realtime_kit/preset_get_params.py b/src/cloudflare/types/realtime_kit/preset_get_params.py index ef22d315e3d..c83295c7a61 100644 --- a/src/cloudflare/types/realtime_kit/preset_get_params.py +++ b/src/cloudflare/types/realtime_kit/preset_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PresetGetParams"] class PresetGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" page_no: float diff --git a/src/cloudflare/types/realtime_kit/preset_update_params.py b/src/cloudflare/types/realtime_kit/preset_update_params.py index 90be39f237a..87da10b488f 100644 --- a/src/cloudflare/types/realtime_kit/preset_update_params.py +++ b/src/cloudflare/types/realtime_kit/preset_update_params.py @@ -36,7 +36,7 @@ class PresetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/recording_get_recordings_params.py b/src/cloudflare/types/realtime_kit/recording_get_recordings_params.py index 7b86f149214..e6f658309f7 100644 --- a/src/cloudflare/types/realtime_kit/recording_get_recordings_params.py +++ b/src/cloudflare/types/realtime_kit/recording_get_recordings_params.py @@ -4,7 +4,7 @@ from typing import List, Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class RecordingGetRecordingsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" end_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/realtime_kit/recording_pause_resume_stop_recording_params.py b/src/cloudflare/types/realtime_kit/recording_pause_resume_stop_recording_params.py index 2f4fd06f3e5..5d1e37a20ff 100644 --- a/src/cloudflare/types/realtime_kit/recording_pause_resume_stop_recording_params.py +++ b/src/cloudflare/types/realtime_kit/recording_pause_resume_stop_recording_params.py @@ -8,7 +8,7 @@ class RecordingPauseResumeStopRecordingParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/recording_start_recordings_params.py b/src/cloudflare/types/realtime_kit/recording_start_recordings_params.py index c1fdd2887e2..550a5b31e79 100644 --- a/src/cloudflare/types/realtime_kit/recording_start_recordings_params.py +++ b/src/cloudflare/types/realtime_kit/recording_start_recordings_params.py @@ -19,7 +19,7 @@ class RecordingStartRecordingsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" allow_multiple_recordings: bool diff --git a/src/cloudflare/types/realtime_kit/recording_start_track_recording_params.py b/src/cloudflare/types/realtime_kit/recording_start_track_recording_params.py index 1e34d1ed8d9..0b0de90f89a 100644 --- a/src/cloudflare/types/realtime_kit/recording_start_track_recording_params.py +++ b/src/cloudflare/types/realtime_kit/recording_start_track_recording_params.py @@ -9,7 +9,7 @@ class RecordingStartTrackRecordingParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" layers: Required[Dict[str, Layers]] diff --git a/src/cloudflare/types/realtime_kit/session_get_participant_data_from_peer_id_params.py b/src/cloudflare/types/realtime_kit/session_get_participant_data_from_peer_id_params.py index 3f52147f147..b0976a7a812 100644 --- a/src/cloudflare/types/realtime_kit/session_get_participant_data_from_peer_id_params.py +++ b/src/cloudflare/types/realtime_kit/session_get_participant_data_from_peer_id_params.py @@ -8,7 +8,7 @@ class SessionGetParticipantDataFromPeerIDParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/session_get_session_details_params.py b/src/cloudflare/types/realtime_kit/session_get_session_details_params.py index c0615876045..daea87d18b7 100644 --- a/src/cloudflare/types/realtime_kit/session_get_session_details_params.py +++ b/src/cloudflare/types/realtime_kit/session_get_session_details_params.py @@ -8,7 +8,7 @@ class SessionGetSessionDetailsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/session_get_session_participant_details_params.py b/src/cloudflare/types/realtime_kit/session_get_session_participant_details_params.py index a28608d403e..6cc600c7bca 100644 --- a/src/cloudflare/types/realtime_kit/session_get_session_participant_details_params.py +++ b/src/cloudflare/types/realtime_kit/session_get_session_participant_details_params.py @@ -8,7 +8,7 @@ class SessionGetSessionParticipantDetailsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/session_get_session_participants_params.py b/src/cloudflare/types/realtime_kit/session_get_session_participants_params.py index a2a50190639..7cee9e192e5 100644 --- a/src/cloudflare/types/realtime_kit/session_get_session_participants_params.py +++ b/src/cloudflare/types/realtime_kit/session_get_session_participants_params.py @@ -8,7 +8,7 @@ class SessionGetSessionParticipantsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/session_get_sessions_params.py b/src/cloudflare/types/realtime_kit/session_get_sessions_params.py index b64cf40ccd5..8978b5d43da 100644 --- a/src/cloudflare/types/realtime_kit/session_get_sessions_params.py +++ b/src/cloudflare/types/realtime_kit/session_get_sessions_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class SessionGetSessionsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" associated_id: str diff --git a/src/cloudflare/types/realtime_kit/webhook_create_webhook_params.py b/src/cloudflare/types/realtime_kit/webhook_create_webhook_params.py index 7dc23b4dcb2..c16f99a451c 100644 --- a/src/cloudflare/types/realtime_kit/webhook_create_webhook_params.py +++ b/src/cloudflare/types/realtime_kit/webhook_create_webhook_params.py @@ -9,7 +9,7 @@ class WebhookCreateWebhookParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" events: Required[ diff --git a/src/cloudflare/types/realtime_kit/webhook_edit_webhook_params.py b/src/cloudflare/types/realtime_kit/webhook_edit_webhook_params.py index 9e8c9bcb97c..5b4e7ded101 100644 --- a/src/cloudflare/types/realtime_kit/webhook_edit_webhook_params.py +++ b/src/cloudflare/types/realtime_kit/webhook_edit_webhook_params.py @@ -9,7 +9,7 @@ class WebhookEditWebhookParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/realtime_kit/webhook_replace_webhook_params.py b/src/cloudflare/types/realtime_kit/webhook_replace_webhook_params.py index bc27108bc53..74732bdbf45 100644 --- a/src/cloudflare/types/realtime_kit/webhook_replace_webhook_params.py +++ b/src/cloudflare/types/realtime_kit/webhook_replace_webhook_params.py @@ -9,7 +9,7 @@ class WebhookReplaceWebhookParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" app_id: Required[str] diff --git a/src/cloudflare/types/registrar/domain_update_params.py b/src/cloudflare/types/registrar/domain_update_params.py index 5c6da427594..c69ee2fe840 100644 --- a/src/cloudflare/types/registrar/domain_update_params.py +++ b/src/cloudflare/types/registrar/domain_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DomainUpdateParams"] class DomainUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" auto_renew: bool diff --git a/src/cloudflare/types/registrar/registrar_check_params.py b/src/cloudflare/types/registrar/registrar_check_params.py index 663932047ff..fd48b15dc15 100644 --- a/src/cloudflare/types/registrar/registrar_check_params.py +++ b/src/cloudflare/types/registrar/registrar_check_params.py @@ -10,7 +10,7 @@ class RegistrarCheckParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" domains: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/registrar/registrar_search_params.py b/src/cloudflare/types/registrar/registrar_search_params.py index bbd35e7e9b5..4dc2945e42c 100644 --- a/src/cloudflare/types/registrar/registrar_search_params.py +++ b/src/cloudflare/types/registrar/registrar_search_params.py @@ -10,7 +10,7 @@ class RegistrarSearchParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" q: Required[str] diff --git a/src/cloudflare/types/registrar/registration_create_params.py b/src/cloudflare/types/registrar/registration_create_params.py index b4b5022a4c2..6ff16a019ed 100644 --- a/src/cloudflare/types/registrar/registration_create_params.py +++ b/src/cloudflare/types/registrar/registration_create_params.py @@ -16,7 +16,7 @@ class RegistrationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" domain_name: Required[str] diff --git a/src/cloudflare/types/registrar/registration_edit_params.py b/src/cloudflare/types/registrar/registration_edit_params.py index 48f70de8f16..348b9fb99bd 100644 --- a/src/cloudflare/types/registrar/registration_edit_params.py +++ b/src/cloudflare/types/registrar/registration_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class RegistrationEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" auto_renew: bool diff --git a/src/cloudflare/types/registrar/registration_list_params.py b/src/cloudflare/types/registrar/registration_list_params.py index 962e7562dfd..87155c90de4 100644 --- a/src/cloudflare/types/registrar/registration_list_params.py +++ b/src/cloudflare/types/registrar/registration_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RegistrationListParams"] class RegistrationListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" cursor: str diff --git a/src/cloudflare/types/request_tracers/trace_create_params.py b/src/cloudflare/types/request_tracers/trace_create_params.py index 999190ed744..184d290a90a 100644 --- a/src/cloudflare/types/request_tracers/trace_create_params.py +++ b/src/cloudflare/types/request_tracers/trace_create_params.py @@ -9,7 +9,7 @@ class TraceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" method: Required[str] diff --git a/src/cloudflare/types/resource_sharing/recipient_create_params.py b/src/cloudflare/types/resource_sharing/recipient_create_params.py index 6384dc2152e..58b143bcada 100644 --- a/src/cloudflare/types/resource_sharing/recipient_create_params.py +++ b/src/cloudflare/types/resource_sharing/recipient_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class RecipientCreateParams(TypedDict, total=False): - path_account_id: Annotated[str, PropertyInfo(alias="account_id")] + path_account_id: Required[Annotated[str, PropertyInfo(alias="account_id")]] """Account identifier.""" body_account_id: Annotated[str, PropertyInfo(alias="account_id")] diff --git a/src/cloudflare/types/resource_sharing/recipient_get_params.py b/src/cloudflare/types/resource_sharing/recipient_get_params.py index b451cbcb69e..beaa5c36c21 100644 --- a/src/cloudflare/types/resource_sharing/recipient_get_params.py +++ b/src/cloudflare/types/resource_sharing/recipient_get_params.py @@ -8,7 +8,7 @@ class RecipientGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" share_id: Required[str] diff --git a/src/cloudflare/types/resource_sharing/recipient_list_params.py b/src/cloudflare/types/resource_sharing/recipient_list_params.py index 5907b690150..81723455101 100644 --- a/src/cloudflare/types/resource_sharing/recipient_list_params.py +++ b/src/cloudflare/types/resource_sharing/recipient_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RecipientListParams"] class RecipientListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" include_resources: bool diff --git a/src/cloudflare/types/resource_sharing/resource_create_params.py b/src/cloudflare/types/resource_sharing/resource_create_params.py index 6e4122fe3b9..a5b1f95764f 100644 --- a/src/cloudflare/types/resource_sharing/resource_create_params.py +++ b/src/cloudflare/types/resource_sharing/resource_create_params.py @@ -8,7 +8,7 @@ class ResourceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" meta: Required[object] diff --git a/src/cloudflare/types/resource_sharing/resource_list_params.py b/src/cloudflare/types/resource_sharing/resource_list_params.py index 2103dce349c..cad9c27cae1 100644 --- a/src/cloudflare/types/resource_sharing/resource_list_params.py +++ b/src/cloudflare/types/resource_sharing/resource_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ResourceListParams"] class ResourceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" page: int diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py index 3f7c75a4670..d5adacfdba7 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py @@ -9,7 +9,7 @@ class ResourceSharingCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" name: Required[str] diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_get_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_get_params.py index c905d9e8636..a84c94c5892 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_get_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ResourceSharingGetParams"] class ResourceSharingGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" include_recipient_counts: bool diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py index dd1195de629..5b96649e2c3 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ResourceSharingListParams"] class ResourceSharingListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_update_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_update_params.py index 35cfcffb627..6d796532f5a 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_update_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_update_params.py @@ -8,7 +8,7 @@ class ResourceSharingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" name: Required[str] diff --git a/src/cloudflare/types/resource_sharing/resource_update_params.py b/src/cloudflare/types/resource_sharing/resource_update_params.py index 23c469c064e..d69bbdc0eb0 100644 --- a/src/cloudflare/types/resource_sharing/resource_update_params.py +++ b/src/cloudflare/types/resource_sharing/resource_update_params.py @@ -8,7 +8,7 @@ class ResourceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier.""" share_id: Required[str] diff --git a/src/cloudflare/types/resource_tagging/account_tag_get_params.py b/src/cloudflare/types/resource_tagging/account_tag_get_params.py index 919526e9260..7a0340f55ab 100644 --- a/src/cloudflare/types/resource_tagging/account_tag_get_params.py +++ b/src/cloudflare/types/resource_tagging/account_tag_get_params.py @@ -8,7 +8,7 @@ class AccountTagGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" resource_id: Required[str] diff --git a/src/cloudflare/types/resource_tagging/account_tag_update_params.py b/src/cloudflare/types/resource_tagging/account_tag_update_params.py index 7b2e6ebe08d..1fb41f29a2a 100644 --- a/src/cloudflare/types/resource_tagging/account_tag_update_params.py +++ b/src/cloudflare/types/resource_tagging/account_tag_update_params.py @@ -15,7 +15,7 @@ class ResourceTaggingSetTagsRequestAccountLevelWorkerVersion(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" resource_id: Required[str] @@ -60,7 +60,7 @@ class ResourceTaggingSetTagsRequestAccountLevelWorkerVersion(TypedDict, total=Fa class ResourceTaggingSetTagsRequestAccountLevelBase(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" resource_id: Required[str] diff --git a/src/cloudflare/types/resource_tagging/key_list_params.py b/src/cloudflare/types/resource_tagging/key_list_params.py index 6dd43633fdd..3511a00e252 100644 --- a/src/cloudflare/types/resource_tagging/key_list_params.py +++ b/src/cloudflare/types/resource_tagging/key_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["KeyListParams"] class KeyListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cursor: str diff --git a/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py b/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py index c1e5f8a9459..ed7e4758489 100644 --- a/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py +++ b/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class ResourceTaggingListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cursor: str diff --git a/src/cloudflare/types/resource_tagging/value_list_params.py b/src/cloudflare/types/resource_tagging/value_list_params.py index 66b79beb171..f154de3a39c 100644 --- a/src/cloudflare/types/resource_tagging/value_list_params.py +++ b/src/cloudflare/types/resource_tagging/value_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ValueListParams"] class ValueListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cursor: str diff --git a/src/cloudflare/types/resource_tagging/zone_tag_get_params.py b/src/cloudflare/types/resource_tagging/zone_tag_get_params.py index b2a511fdffd..41e8fbbbe22 100644 --- a/src/cloudflare/types/resource_tagging/zone_tag_get_params.py +++ b/src/cloudflare/types/resource_tagging/zone_tag_get_params.py @@ -8,7 +8,7 @@ class ZoneTagGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone ID is required only for zone-level resources""" resource_id: Required[str] diff --git a/src/cloudflare/types/resource_tagging/zone_tag_update_params.py b/src/cloudflare/types/resource_tagging/zone_tag_update_params.py index 8542e88dffb..9b9fa8a54fa 100644 --- a/src/cloudflare/types/resource_tagging/zone_tag_update_params.py +++ b/src/cloudflare/types/resource_tagging/zone_tag_update_params.py @@ -15,7 +15,7 @@ class ResourceTaggingSetTagsRequestZoneLevelBase(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone ID is required only for zone-level resources""" resource_id: Required[str] @@ -40,7 +40,7 @@ class ResourceTaggingSetTagsRequestZoneLevelBase(TypedDict, total=False): class ResourceTaggingSetTagsRequestZoneLevelAccessApplicationPolicy(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone ID is required only for zone-level resources""" access_application_id: Required[str] diff --git a/src/cloudflare/types/rules/list_create_params.py b/src/cloudflare/types/rules/list_create_params.py index 62f9c943133..a0ecda97394 100644 --- a/src/cloudflare/types/rules/list_create_params.py +++ b/src/cloudflare/types/rules/list_create_params.py @@ -8,7 +8,7 @@ class ListCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" kind: Required[Literal["ip", "redirect", "hostname", "asn"]] diff --git a/src/cloudflare/types/rules/list_update_params.py b/src/cloudflare/types/rules/list_update_params.py index 1620290507b..1b37842360b 100644 --- a/src/cloudflare/types/rules/list_update_params.py +++ b/src/cloudflare/types/rules/list_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ListUpdateParams"] class ListUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" description: str diff --git a/src/cloudflare/types/rules/lists/item_create_params.py b/src/cloudflare/types/rules/lists/item_create_params.py index ad17ea76f4a..d8d4e8646eb 100644 --- a/src/cloudflare/types/rules/lists/item_create_params.py +++ b/src/cloudflare/types/rules/lists/item_create_params.py @@ -19,7 +19,7 @@ class ItemCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/rules/lists/item_delete_params.py b/src/cloudflare/types/rules/lists/item_delete_params.py index 8d917743119..9ab6856dad9 100644 --- a/src/cloudflare/types/rules/lists/item_delete_params.py +++ b/src/cloudflare/types/rules/lists/item_delete_params.py @@ -9,7 +9,7 @@ class ItemDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" items: Iterable[Item] diff --git a/src/cloudflare/types/rules/lists/item_list_params.py b/src/cloudflare/types/rules/lists/item_list_params.py index bfd9cfd2a12..55374a19c0b 100644 --- a/src/cloudflare/types/rules/lists/item_list_params.py +++ b/src/cloudflare/types/rules/lists/item_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ItemListParams"] class ItemListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" cursor: str diff --git a/src/cloudflare/types/rules/lists/item_update_params.py b/src/cloudflare/types/rules/lists/item_update_params.py index cc3c5b8d02b..f61262a02c8 100644 --- a/src/cloudflare/types/rules/lists/item_update_params.py +++ b/src/cloudflare/types/rules/lists/item_update_params.py @@ -19,7 +19,7 @@ class ItemUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The Account ID for this resource.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/rum/rule_bulk_create_params.py b/src/cloudflare/types/rum/rule_bulk_create_params.py index 128c4b0b192..11ba2bfc19d 100644 --- a/src/cloudflare/types/rum/rule_bulk_create_params.py +++ b/src/cloudflare/types/rum/rule_bulk_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -11,7 +11,7 @@ class RuleBulkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" delete_rules: SequenceNotStr[str] diff --git a/src/cloudflare/types/rum/rule_create_params.py b/src/cloudflare/types/rum/rule_create_params.py index 808e47c419b..45bf57b63b4 100644 --- a/src/cloudflare/types/rum/rule_create_params.py +++ b/src/cloudflare/types/rum/rule_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class RuleCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" host: str diff --git a/src/cloudflare/types/rum/rule_update_params.py b/src/cloudflare/types/rum/rule_update_params.py index 8210d8323ec..cd16ad9cbc3 100644 --- a/src/cloudflare/types/rum/rule_update_params.py +++ b/src/cloudflare/types/rum/rule_update_params.py @@ -10,7 +10,7 @@ class RuleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" ruleset_id: Required[str] diff --git a/src/cloudflare/types/rum/site_info_create_params.py b/src/cloudflare/types/rum/site_info_create_params.py index 3190ad86e70..1c5741fc7ba 100644 --- a/src/cloudflare/types/rum/site_info_create_params.py +++ b/src/cloudflare/types/rum/site_info_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SiteInfoCreateParams"] class SiteInfoCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" auto_install: bool diff --git a/src/cloudflare/types/rum/site_info_list_params.py b/src/cloudflare/types/rum/site_info_list_params.py index f24b9890d84..5d20ee77a52 100644 --- a/src/cloudflare/types/rum/site_info_list_params.py +++ b/src/cloudflare/types/rum/site_info_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SiteInfoListParams"] class SiteInfoListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" order_by: Literal["host", "created"] diff --git a/src/cloudflare/types/rum/site_info_update_params.py b/src/cloudflare/types/rum/site_info_update_params.py index 57b6c97025f..8c46b5e3cb7 100644 --- a/src/cloudflare/types/rum/site_info_update_params.py +++ b/src/cloudflare/types/rum/site_info_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SiteInfoUpdateParams"] class SiteInfoUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" auto_install: bool diff --git a/src/cloudflare/types/schema_validation/schema_create_params.py b/src/cloudflare/types/schema_validation/schema_create_params.py index dc263454e79..585316e7cf3 100644 --- a/src/cloudflare/types/schema_validation/schema_create_params.py +++ b/src/cloudflare/types/schema_validation/schema_create_params.py @@ -8,7 +8,7 @@ class SchemaCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" kind: Required[Literal["openapi_v3"]] diff --git a/src/cloudflare/types/schema_validation/schema_edit_params.py b/src/cloudflare/types/schema_validation/schema_edit_params.py index 2ac44efaed2..074e692fce5 100644 --- a/src/cloudflare/types/schema_validation/schema_edit_params.py +++ b/src/cloudflare/types/schema_validation/schema_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SchemaEditParams"] class SchemaEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_enabled: bool diff --git a/src/cloudflare/types/schema_validation/schema_get_params.py b/src/cloudflare/types/schema_validation/schema_get_params.py index 82baf45494a..9da2522edf0 100644 --- a/src/cloudflare/types/schema_validation/schema_get_params.py +++ b/src/cloudflare/types/schema_validation/schema_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SchemaGetParams"] class SchemaGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" omit_source: bool diff --git a/src/cloudflare/types/schema_validation/schema_list_params.py b/src/cloudflare/types/schema_validation/schema_list_params.py index e614641c742..c286bdd8a5b 100644 --- a/src/cloudflare/types/schema_validation/schema_list_params.py +++ b/src/cloudflare/types/schema_validation/schema_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SchemaListParams"] class SchemaListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" omit_source: bool diff --git a/src/cloudflare/types/schema_validation/setting_edit_params.py b/src/cloudflare/types/schema_validation/setting_edit_params.py index e5d9194fb0c..81f3bd15537 100644 --- a/src/cloudflare/types/schema_validation/setting_edit_params.py +++ b/src/cloudflare/types/schema_validation/setting_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SettingEditParams"] class SettingEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_default_mitigation_action: Literal["none", "log", "block"] diff --git a/src/cloudflare/types/schema_validation/setting_update_params.py b/src/cloudflare/types/schema_validation/setting_update_params.py index 411ad5ac2dd..c6e641c373c 100644 --- a/src/cloudflare/types/schema_validation/setting_update_params.py +++ b/src/cloudflare/types/schema_validation/setting_update_params.py @@ -9,7 +9,7 @@ class SettingUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_default_mitigation_action: Required[Literal["none", "log", "block"]] diff --git a/src/cloudflare/types/schema_validation/settings/operation_bulk_edit_params.py b/src/cloudflare/types/schema_validation/settings/operation_bulk_edit_params.py index e726438994f..d1ce1c2c929 100644 --- a/src/cloudflare/types/schema_validation/settings/operation_bulk_edit_params.py +++ b/src/cloudflare/types/schema_validation/settings/operation_bulk_edit_params.py @@ -9,7 +9,7 @@ class OperationBulkEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Dict[str, Body]] diff --git a/src/cloudflare/types/schema_validation/settings/operation_list_params.py b/src/cloudflare/types/schema_validation/settings/operation_list_params.py index a14797f5de2..79851b36335 100644 --- a/src/cloudflare/types/schema_validation/settings/operation_list_params.py +++ b/src/cloudflare/types/schema_validation/settings/operation_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["OperationListParams"] class OperationListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/schema_validation/settings/operation_update_params.py b/src/cloudflare/types/schema_validation/settings/operation_update_params.py index 15db268b3f0..34cd95b5fc1 100644 --- a/src/cloudflare/types/schema_validation/settings/operation_update_params.py +++ b/src/cloudflare/types/schema_validation/settings/operation_update_params.py @@ -9,7 +9,7 @@ class OperationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" mitigation_action: Required[Optional[Literal["log", "block", "none"]]] diff --git a/src/cloudflare/types/secrets_store/store_create_params.py b/src/cloudflare/types/secrets_store/store_create_params.py index 788b3bbfb8a..d359c3bbce9 100644 --- a/src/cloudflare/types/secrets_store/store_create_params.py +++ b/src/cloudflare/types/secrets_store/store_create_params.py @@ -8,7 +8,7 @@ class StoreCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" name: Required[str] diff --git a/src/cloudflare/types/secrets_store/store_list_params.py b/src/cloudflare/types/secrets_store/store_list_params.py index e3432db39ef..19d56210b25 100644 --- a/src/cloudflare/types/secrets_store/store_list_params.py +++ b/src/cloudflare/types/secrets_store/store_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["StoreListParams"] class StoreListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/secrets_store/stores/secret_create_params.py b/src/cloudflare/types/secrets_store/stores/secret_create_params.py index db2fb7d6821..53e2f79e25c 100644 --- a/src/cloudflare/types/secrets_store/stores/secret_create_params.py +++ b/src/cloudflare/types/secrets_store/stores/secret_create_params.py @@ -11,7 +11,7 @@ class SecretCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" body: Required[Iterable[Body]] @@ -27,8 +27,8 @@ class Body(TypedDict, total=False): value: Required[str] """The value of the secret. - Note that this is 'write only' - no API reponse will provide this value, it is - only used to create/modify secrets. + Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response + will provide this value, it is only used to create/modify secrets. """ comment: str diff --git a/src/cloudflare/types/secrets_store/stores/secret_duplicate_params.py b/src/cloudflare/types/secrets_store/stores/secret_duplicate_params.py index 1de2f598248..73a262b30a7 100644 --- a/src/cloudflare/types/secrets_store/stores/secret_duplicate_params.py +++ b/src/cloudflare/types/secrets_store/stores/secret_duplicate_params.py @@ -10,7 +10,7 @@ class SecretDuplicateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" store_id: Required[str] diff --git a/src/cloudflare/types/secrets_store/stores/secret_edit_params.py b/src/cloudflare/types/secrets_store/stores/secret_edit_params.py index ef19e79aa8e..cd5076c84c9 100644 --- a/src/cloudflare/types/secrets_store/stores/secret_edit_params.py +++ b/src/cloudflare/types/secrets_store/stores/secret_edit_params.py @@ -10,7 +10,7 @@ class SecretEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" store_id: Required[str] @@ -25,6 +25,6 @@ class SecretEditParams(TypedDict, total=False): value: str """The value of the secret. - Note that this is 'write only' - no API reponse will provide this value, it is - only used to create/modify secrets. + Maximum 64 KiB (65,536 bytes). Note that this is 'write only' - no API response + will provide this value, it is only used to create/modify secrets. """ diff --git a/src/cloudflare/types/secrets_store/stores/secret_list_params.py b/src/cloudflare/types/secrets_store/stores/secret_list_params.py index 5a76f649f9b..ad101503e83 100644 --- a/src/cloudflare/types/secrets_store/stores/secret_list_params.py +++ b/src/cloudflare/types/secrets_store/stores/secret_list_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -11,7 +11,7 @@ class SecretListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/security_txt/security_txt_update_params.py b/src/cloudflare/types/security_txt/security_txt_update_params.py index e19e3c9b9c6..ccd935f7bed 100644 --- a/src/cloudflare/types/security_txt/security_txt_update_params.py +++ b/src/cloudflare/types/security_txt/security_txt_update_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -13,7 +13,7 @@ class SecurityTXTUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" acknowledgments: SequenceNotStr[str] diff --git a/src/cloudflare/types/snippets/rule_update_params.py b/src/cloudflare/types/snippets/rule_update_params.py index 688e9060cad..9511ef89cf8 100644 --- a/src/cloudflare/types/snippets/rule_update_params.py +++ b/src/cloudflare/types/snippets/rule_update_params.py @@ -9,7 +9,7 @@ class RuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Use this field to specify the unique ID of the zone.""" rules: Required[Iterable[Rule]] diff --git a/src/cloudflare/types/snippets/snippet_list_params.py b/src/cloudflare/types/snippets/snippet_list_params.py index 20787161dbe..6a88fa28753 100644 --- a/src/cloudflare/types/snippets/snippet_list_params.py +++ b/src/cloudflare/types/snippets/snippet_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SnippetListParams"] class SnippetListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Use this field to specify the unique ID of the zone.""" page: int diff --git a/src/cloudflare/types/snippets/snippet_update_params.py b/src/cloudflare/types/snippets/snippet_update_params.py index 8085e6c686b..9018359d3cf 100644 --- a/src/cloudflare/types/snippets/snippet_update_params.py +++ b/src/cloudflare/types/snippets/snippet_update_params.py @@ -8,7 +8,7 @@ class SnippetUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Use this field to specify the unique ID of the zone.""" metadata: Required[Metadata] diff --git a/src/cloudflare/types/spectrum/analytics/aggregates/current_get_params.py b/src/cloudflare/types/spectrum/analytics/aggregates/current_get_params.py index 021e3e02a38..62e4567343d 100644 --- a/src/cloudflare/types/spectrum/analytics/aggregates/current_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/aggregates/current_get_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ....._utils import PropertyInfo @@ -10,7 +10,7 @@ class CurrentGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" app_id: Annotated[str, PropertyInfo(alias="appID")] diff --git a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py index ff139691ebc..d0093aefdcc 100644 --- a/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/bytime_get_params.py @@ -14,7 +14,7 @@ class BytimeGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" time_delta: Required[Literal["year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"]] diff --git a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py index 73350abfd56..49158c5ae50 100644 --- a/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py +++ b/src/cloudflare/types/spectrum/analytics/events/summary_get_params.py @@ -4,7 +4,7 @@ from typing import List, Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ....._types import SequenceNotStr from ....._utils import PropertyInfo @@ -14,7 +14,7 @@ class SummaryGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" dimensions: List[Dimension] diff --git a/src/cloudflare/types/spectrum/app_create_params.py b/src/cloudflare/types/spectrum/app_create_params.py index a42065dff51..8927bec1bf7 100644 --- a/src/cloudflare/types/spectrum/app_create_params.py +++ b/src/cloudflare/types/spectrum/app_create_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone identifier.""" dns: Required[DNSParam] @@ -85,7 +85,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone identifier.""" dns: Required[DNSParam] diff --git a/src/cloudflare/types/spectrum/app_list_params.py b/src/cloudflare/types/spectrum/app_list_params.py index bc2351bb116..84e5876649c 100644 --- a/src/cloudflare/types/spectrum/app_list_params.py +++ b/src/cloudflare/types/spectrum/app_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AppListParams"] class AppListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone identifier.""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/spectrum/app_update_params.py b/src/cloudflare/types/spectrum/app_update_params.py index 03df27f5a7b..1c51cd912d6 100644 --- a/src/cloudflare/types/spectrum/app_update_params.py +++ b/src/cloudflare/types/spectrum/app_update_params.py @@ -15,7 +15,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone identifier.""" dns: Required[DNSParam] @@ -85,7 +85,7 @@ class SpectrumConfigAppConfig(TypedDict, total=False): class SpectrumConfigPaygoAppConfig(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Zone identifier.""" dns: Required[DNSParam] diff --git a/src/cloudflare/types/speed/page_trend_params.py b/src/cloudflare/types/speed/page_trend_params.py index eb7af0dae85..b459824cc20 100644 --- a/src/cloudflare/types/speed/page_trend_params.py +++ b/src/cloudflare/types/speed/page_trend_params.py @@ -12,7 +12,7 @@ class PageTrendParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" device_type: Required[Annotated[Literal["DESKTOP", "MOBILE"], PropertyInfo(alias="deviceType")]] diff --git a/src/cloudflare/types/speed/pages/test_create_params.py b/src/cloudflare/types/speed/pages/test_create_params.py index 1e58d3584c2..59d1d27a61c 100644 --- a/src/cloudflare/types/speed/pages/test_create_params.py +++ b/src/cloudflare/types/speed/pages/test_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TestCreateParams"] class TestCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" region: Literal[ diff --git a/src/cloudflare/types/speed/pages/test_delete_params.py b/src/cloudflare/types/speed/pages/test_delete_params.py index 623ed819fe8..7481c7403dd 100644 --- a/src/cloudflare/types/speed/pages/test_delete_params.py +++ b/src/cloudflare/types/speed/pages/test_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TestDeleteParams"] class TestDeleteParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" region: Literal[ diff --git a/src/cloudflare/types/speed/pages/test_list_params.py b/src/cloudflare/types/speed/pages/test_list_params.py index 3c52d99aacd..d6dc3167860 100644 --- a/src/cloudflare/types/speed/pages/test_list_params.py +++ b/src/cloudflare/types/speed/pages/test_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TestListParams"] class TestListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/speed/schedule_create_params.py b/src/cloudflare/types/speed/schedule_create_params.py index 6832034e574..c36a7880435 100644 --- a/src/cloudflare/types/speed/schedule_create_params.py +++ b/src/cloudflare/types/speed/schedule_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScheduleCreateParams"] class ScheduleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" frequency: Literal["DAILY", "WEEKLY"] diff --git a/src/cloudflare/types/speed/schedule_delete_params.py b/src/cloudflare/types/speed/schedule_delete_params.py index d374e0bf6fd..3248601fc2a 100644 --- a/src/cloudflare/types/speed/schedule_delete_params.py +++ b/src/cloudflare/types/speed/schedule_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScheduleDeleteParams"] class ScheduleDeleteParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" region: Literal[ diff --git a/src/cloudflare/types/speed/schedule_get_params.py b/src/cloudflare/types/speed/schedule_get_params.py index 3f16df160c8..7f3e96ab293 100644 --- a/src/cloudflare/types/speed/schedule_get_params.py +++ b/src/cloudflare/types/speed/schedule_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScheduleGetParams"] class ScheduleGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" region: Literal[ diff --git a/src/cloudflare/types/ssl/analyze_create_params.py b/src/cloudflare/types/ssl/analyze_create_params.py index 11de0c66c56..cc33f00c9cc 100644 --- a/src/cloudflare/types/ssl/analyze_create_params.py +++ b/src/cloudflare/types/ssl/analyze_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..custom_hostnames.bundle_method import BundleMethod @@ -10,7 +10,7 @@ class AnalyzeCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" bundle_method: BundleMethod diff --git a/src/cloudflare/types/ssl/certificate_pack_create_params.py b/src/cloudflare/types/ssl/certificate_pack_create_params.py index 3b1791f4736..1b52c52d05f 100644 --- a/src/cloudflare/types/ssl/certificate_pack_create_params.py +++ b/src/cloudflare/types/ssl/certificate_pack_create_params.py @@ -11,7 +11,7 @@ class CertificatePackCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" certificate_authority: Required[Literal["google", "lets_encrypt", "ssl_com"]] diff --git a/src/cloudflare/types/ssl/certificate_pack_edit_params.py b/src/cloudflare/types/ssl/certificate_pack_edit_params.py index 20e36feddf8..ac1eb503f9b 100644 --- a/src/cloudflare/types/ssl/certificate_pack_edit_params.py +++ b/src/cloudflare/types/ssl/certificate_pack_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CertificatePackEditParams"] class CertificatePackEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" cloudflare_branding: bool diff --git a/src/cloudflare/types/ssl/certificate_pack_list_params.py b/src/cloudflare/types/ssl/certificate_pack_list_params.py index 0831fdd669e..b231888d073 100644 --- a/src/cloudflare/types/ssl/certificate_pack_list_params.py +++ b/src/cloudflare/types/ssl/certificate_pack_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CertificatePackListParams"] class CertificatePackListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" deploy: Literal["staging", "production"] diff --git a/src/cloudflare/types/ssl/universal/setting_edit_params.py b/src/cloudflare/types/ssl/universal/setting_edit_params.py index 73949043af8..e7e19a63085 100644 --- a/src/cloudflare/types/ssl/universal/setting_edit_params.py +++ b/src/cloudflare/types/ssl/universal/setting_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingEditParams"] class SettingEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: bool diff --git a/src/cloudflare/types/ssl/verification_edit_params.py b/src/cloudflare/types/ssl/verification_edit_params.py index f02c342e438..2ec2389f68b 100644 --- a/src/cloudflare/types/ssl/verification_edit_params.py +++ b/src/cloudflare/types/ssl/verification_edit_params.py @@ -8,7 +8,7 @@ class VerificationEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" validation_method: Required[Literal["http", "cname", "txt", "email"]] diff --git a/src/cloudflare/types/ssl/verification_get_params.py b/src/cloudflare/types/ssl/verification_get_params.py index 6560cb3856b..1f33b183f83 100644 --- a/src/cloudflare/types/ssl/verification_get_params.py +++ b/src/cloudflare/types/ssl/verification_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["VerificationGetParams"] class VerificationGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" retry: Literal[True] diff --git a/src/cloudflare/types/stream/audio_track_copy_params.py b/src/cloudflare/types/stream/audio_track_copy_params.py index 1d5c48c729d..599c1adb399 100644 --- a/src/cloudflare/types/stream/audio_track_copy_params.py +++ b/src/cloudflare/types/stream/audio_track_copy_params.py @@ -8,7 +8,7 @@ class AudioTrackCopyParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" label: Required[str] diff --git a/src/cloudflare/types/stream/audio_track_edit_params.py b/src/cloudflare/types/stream/audio_track_edit_params.py index 7d851b826ea..6463f48b26b 100644 --- a/src/cloudflare/types/stream/audio_track_edit_params.py +++ b/src/cloudflare/types/stream/audio_track_edit_params.py @@ -8,7 +8,7 @@ class AudioTrackEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" identifier: Required[str] diff --git a/src/cloudflare/types/stream/captions/language_update_params.py b/src/cloudflare/types/stream/captions/language_update_params.py index e528e05fde1..5c9b702792b 100644 --- a/src/cloudflare/types/stream/captions/language_update_params.py +++ b/src/cloudflare/types/stream/captions/language_update_params.py @@ -8,7 +8,7 @@ class LanguageUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" identifier: Required[str] diff --git a/src/cloudflare/types/stream/clip_create_params.py b/src/cloudflare/types/stream/clip_create_params.py index 09a20b0f232..e04adad50aa 100644 --- a/src/cloudflare/types/stream/clip_create_params.py +++ b/src/cloudflare/types/stream/clip_create_params.py @@ -14,7 +14,7 @@ class ClipCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" clipped_from_video_uid: Required[Annotated[str, PropertyInfo(alias="clippedFromVideoUID")]] diff --git a/src/cloudflare/types/stream/copy_create_params.py b/src/cloudflare/types/stream/copy_create_params.py index 383d686c7bb..22f6bb86824 100644 --- a/src/cloudflare/types/stream/copy_create_params.py +++ b/src/cloudflare/types/stream/copy_create_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -14,7 +14,7 @@ class CopyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" allowed_origins: Annotated[SequenceNotStr[AllowedOrigins], PropertyInfo(alias="allowedOrigins")] diff --git a/src/cloudflare/types/stream/direct_upload_create_params.py b/src/cloudflare/types/stream/direct_upload_create_params.py index ada6e59930c..196794ac8cd 100644 --- a/src/cloudflare/types/stream/direct_upload_create_params.py +++ b/src/cloudflare/types/stream/direct_upload_create_params.py @@ -14,7 +14,7 @@ class DirectUploadCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" max_duration_seconds: Required[Annotated[int, PropertyInfo(alias="maxDurationSeconds")]] diff --git a/src/cloudflare/types/stream/key_create_params.py b/src/cloudflare/types/stream/key_create_params.py index 968dcd2c885..0e48b1613bb 100644 --- a/src/cloudflare/types/stream/key_create_params.py +++ b/src/cloudflare/types/stream/key_create_params.py @@ -8,7 +8,7 @@ class KeyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[object] diff --git a/src/cloudflare/types/stream/live_input_create_params.py b/src/cloudflare/types/stream/live_input_create_params.py index 8bc7ae7fed0..63f6f095320 100644 --- a/src/cloudflare/types/stream/live_input_create_params.py +++ b/src/cloudflare/types/stream/live_input_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -11,7 +11,7 @@ class LiveInputCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" default_creator: Annotated[str, PropertyInfo(alias="defaultCreator")] diff --git a/src/cloudflare/types/stream/live_input_list_params.py b/src/cloudflare/types/stream/live_input_list_params.py index 9ea088d3803..7daa7840150 100644 --- a/src/cloudflare/types/stream/live_input_list_params.py +++ b/src/cloudflare/types/stream/live_input_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["LiveInputListParams"] class LiveInputListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" include_counts: bool diff --git a/src/cloudflare/types/stream/live_input_update_params.py b/src/cloudflare/types/stream/live_input_update_params.py index 80dca8e1687..248048df5af 100644 --- a/src/cloudflare/types/stream/live_input_update_params.py +++ b/src/cloudflare/types/stream/live_input_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -11,7 +11,7 @@ class LiveInputUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" default_creator: Annotated[str, PropertyInfo(alias="defaultCreator")] diff --git a/src/cloudflare/types/stream/live_inputs/output_create_params.py b/src/cloudflare/types/stream/live_inputs/output_create_params.py index d7088828a3a..a07db015a54 100644 --- a/src/cloudflare/types/stream/live_inputs/output_create_params.py +++ b/src/cloudflare/types/stream/live_inputs/output_create_params.py @@ -10,7 +10,7 @@ class OutputCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" stream_key: Required[Annotated[str, PropertyInfo(alias="streamKey")]] diff --git a/src/cloudflare/types/stream/live_inputs/output_update_params.py b/src/cloudflare/types/stream/live_inputs/output_update_params.py index a5ed6b2b21b..f364723888d 100644 --- a/src/cloudflare/types/stream/live_inputs/output_update_params.py +++ b/src/cloudflare/types/stream/live_inputs/output_update_params.py @@ -8,7 +8,7 @@ class OutputUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" live_input_identifier: Required[str] diff --git a/src/cloudflare/types/stream/stream_create_params.py b/src/cloudflare/types/stream/stream_create_params.py index 3626fbfc2c7..38ee4f3f9db 100644 --- a/src/cloudflare/types/stream/stream_create_params.py +++ b/src/cloudflare/types/stream/stream_create_params.py @@ -10,7 +10,7 @@ class StreamCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" tus_resumable: Required[Annotated[Literal["1.0.0"], PropertyInfo(alias="Tus-Resumable")]] diff --git a/src/cloudflare/types/stream/stream_edit_params.py b/src/cloudflare/types/stream/stream_edit_params.py index 1b50b4d05a0..3ec2c2eecc3 100644 --- a/src/cloudflare/types/stream/stream_edit_params.py +++ b/src/cloudflare/types/stream/stream_edit_params.py @@ -4,7 +4,7 @@ from typing import Union, Optional from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -14,7 +14,7 @@ class StreamEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" allowed_origins: Annotated[SequenceNotStr[AllowedOrigins], PropertyInfo(alias="allowedOrigins")] diff --git a/src/cloudflare/types/stream/stream_list_params.py b/src/cloudflare/types/stream/stream_list_params.py index badeea9782e..7165c3d3dc4 100644 --- a/src/cloudflare/types/stream/stream_list_params.py +++ b/src/cloudflare/types/stream/stream_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class StreamListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" id: str diff --git a/src/cloudflare/types/stream/token_create_params.py b/src/cloudflare/types/stream/token_create_params.py index bf97e9d4c63..7ddc54cfbd8 100644 --- a/src/cloudflare/types/stream/token_create_params.py +++ b/src/cloudflare/types/stream/token_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class TokenCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" id: str diff --git a/src/cloudflare/types/stream/video_storage_usage_params.py b/src/cloudflare/types/stream/video_storage_usage_params.py index 12651e39b27..a17cf902bbd 100644 --- a/src/cloudflare/types/stream/video_storage_usage_params.py +++ b/src/cloudflare/types/stream/video_storage_usage_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["VideoStorageUsageParams"] class VideoStorageUsageParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" creator: str diff --git a/src/cloudflare/types/stream/watermark_create_params.py b/src/cloudflare/types/stream/watermark_create_params.py index b7121cae71d..4fc7d2463fa 100644 --- a/src/cloudflare/types/stream/watermark_create_params.py +++ b/src/cloudflare/types/stream/watermark_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WatermarkCreateParams"] class WatermarkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" name: str diff --git a/src/cloudflare/types/stream/webhook_update_params.py b/src/cloudflare/types/stream/webhook_update_params.py index 1bc00b839b1..65fd67b2670 100644 --- a/src/cloudflare/types/stream/webhook_update_params.py +++ b/src/cloudflare/types/stream/webhook_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class WebhookUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """The account identifier tag.""" body_notification_url_1: Annotated[str, PropertyInfo(alias="notification_url")] diff --git a/src/cloudflare/types/token_validation/configuration/credential_update_params.py b/src/cloudflare/types/token_validation/configuration/credential_update_params.py index f74bfdcaa8c..98896d37d1b 100644 --- a/src/cloudflare/types/token_validation/configuration/credential_update_params.py +++ b/src/cloudflare/types/token_validation/configuration/credential_update_params.py @@ -15,7 +15,7 @@ class CredentialUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" keys: Required[Iterable[Key]] diff --git a/src/cloudflare/types/token_validation/configuration_create_params.py b/src/cloudflare/types/token_validation/configuration_create_params.py index 4ba1be1bc62..e1dc1cbe588 100644 --- a/src/cloudflare/types/token_validation/configuration_create_params.py +++ b/src/cloudflare/types/token_validation/configuration_create_params.py @@ -18,7 +18,7 @@ class ConfigurationCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" credentials: Required[Credentials] diff --git a/src/cloudflare/types/token_validation/configuration_edit_params.py b/src/cloudflare/types/token_validation/configuration_edit_params.py index a702189c49e..8bfeca4a151 100644 --- a/src/cloudflare/types/token_validation/configuration_edit_params.py +++ b/src/cloudflare/types/token_validation/configuration_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class ConfigurationEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" description: str diff --git a/src/cloudflare/types/token_validation/configuration_list_params.py b/src/cloudflare/types/token_validation/configuration_list_params.py index 057a54d9d71..5c5a00f5242 100644 --- a/src/cloudflare/types/token_validation/configuration_list_params.py +++ b/src/cloudflare/types/token_validation/configuration_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ConfigurationListParams"] class ConfigurationListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/token_validation/rule_bulk_create_params.py b/src/cloudflare/types/token_validation/rule_bulk_create_params.py index f16862236ca..36b178812c9 100644 --- a/src/cloudflare/types/token_validation/rule_bulk_create_params.py +++ b/src/cloudflare/types/token_validation/rule_bulk_create_params.py @@ -11,7 +11,7 @@ class RuleBulkCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/token_validation/rule_bulk_edit_params.py b/src/cloudflare/types/token_validation/rule_bulk_edit_params.py index f31da854783..7f68d7806b4 100644 --- a/src/cloudflare/types/token_validation/rule_bulk_edit_params.py +++ b/src/cloudflare/types/token_validation/rule_bulk_edit_params.py @@ -21,7 +21,7 @@ class RuleBulkEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/token_validation/rule_create_params.py b/src/cloudflare/types/token_validation/rule_create_params.py index d8e11b79909..f92cb7d21be 100644 --- a/src/cloudflare/types/token_validation/rule_create_params.py +++ b/src/cloudflare/types/token_validation/rule_create_params.py @@ -11,7 +11,7 @@ class RuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" action: Required[Literal["log", "block"]] diff --git a/src/cloudflare/types/token_validation/rule_edit_params.py b/src/cloudflare/types/token_validation/rule_edit_params.py index ccbd01b5bfb..c59c6da7155 100644 --- a/src/cloudflare/types/token_validation/rule_edit_params.py +++ b/src/cloudflare/types/token_validation/rule_edit_params.py @@ -20,7 +20,7 @@ class RuleEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" action: Literal["log", "block"] diff --git a/src/cloudflare/types/token_validation/rule_list_params.py b/src/cloudflare/types/token_validation/rule_list_params.py index 89d4cff3f86..a241d61c90c 100644 --- a/src/cloudflare/types/token_validation/rule_list_params.py +++ b/src/cloudflare/types/token_validation/rule_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class RuleListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" id: str diff --git a/src/cloudflare/types/turnstile/widget_create_params.py b/src/cloudflare/types/turnstile/widget_create_params.py index 5165dde3e8c..61de9dba0d4 100644 --- a/src/cloudflare/types/turnstile/widget_create_params.py +++ b/src/cloudflare/types/turnstile/widget_create_params.py @@ -11,7 +11,7 @@ class WidgetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" domains: Required[SequenceNotStr[WidgetDomain]] diff --git a/src/cloudflare/types/turnstile/widget_list_params.py b/src/cloudflare/types/turnstile/widget_list_params.py index 2a8512c96ef..a66438ade2e 100644 --- a/src/cloudflare/types/turnstile/widget_list_params.py +++ b/src/cloudflare/types/turnstile/widget_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["WidgetListParams"] class WidgetListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" direction: Literal["asc", "desc"] diff --git a/src/cloudflare/types/turnstile/widget_rotate_secret_params.py b/src/cloudflare/types/turnstile/widget_rotate_secret_params.py index bbaaf51c753..72e9f7b0754 100644 --- a/src/cloudflare/types/turnstile/widget_rotate_secret_params.py +++ b/src/cloudflare/types/turnstile/widget_rotate_secret_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WidgetRotateSecretParams"] class WidgetRotateSecretParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" invalidate_immediately: bool diff --git a/src/cloudflare/types/turnstile/widget_update_params.py b/src/cloudflare/types/turnstile/widget_update_params.py index b605b06e4cd..ac0255a3a42 100644 --- a/src/cloudflare/types/turnstile/widget_update_params.py +++ b/src/cloudflare/types/turnstile/widget_update_params.py @@ -11,7 +11,7 @@ class WidgetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" domains: Required[SequenceNotStr[WidgetDomain]] diff --git a/src/cloudflare/types/url_normalization/url_normalization_update_params.py b/src/cloudflare/types/url_normalization/url_normalization_update_params.py index 973def90dd9..06b9f4e31c5 100644 --- a/src/cloudflare/types/url_normalization/url_normalization_update_params.py +++ b/src/cloudflare/types/url_normalization/url_normalization_update_params.py @@ -8,7 +8,7 @@ class URLNormalizationUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """The unique ID of the zone.""" scope: Required[Literal["incoming", "both", "none"]] diff --git a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py index 0976e9ad0b1..e6bb82e2435 100644 --- a/src/cloudflare/types/url_scanner/scan_bulk_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_bulk_create_params.py @@ -11,7 +11,7 @@ class ScanBulkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" body: Iterable[Body] diff --git a/src/cloudflare/types/url_scanner/scan_create_params.py b/src/cloudflare/types/url_scanner/scan_create_params.py index 6eaf5e4ee73..f991bf2dd71 100644 --- a/src/cloudflare/types/url_scanner/scan_create_params.py +++ b/src/cloudflare/types/url_scanner/scan_create_params.py @@ -11,7 +11,7 @@ class ScanCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" url: Required[str] diff --git a/src/cloudflare/types/url_scanner/scan_list_params.py b/src/cloudflare/types/url_scanner/scan_list_params.py index d784dea614c..97421b92ccc 100644 --- a/src/cloudflare/types/url_scanner/scan_list_params.py +++ b/src/cloudflare/types/url_scanner/scan_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ScanListParams"] class ScanListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" q: str diff --git a/src/cloudflare/types/url_scanner/scan_screenshot_params.py b/src/cloudflare/types/url_scanner/scan_screenshot_params.py index 7c7a1a22ce8..263a003363f 100644 --- a/src/cloudflare/types/url_scanner/scan_screenshot_params.py +++ b/src/cloudflare/types/url_scanner/scan_screenshot_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ScanScreenshotParams"] class ScanScreenshotParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account ID.""" resolution: Literal["desktop", "mobile", "tablet"] diff --git a/src/cloudflare/types/vectorize/index_create_params.py b/src/cloudflare/types/vectorize/index_create_params.py index faa6ad94ba8..1754ce05d18 100644 --- a/src/cloudflare/types/vectorize/index_create_params.py +++ b/src/cloudflare/types/vectorize/index_create_params.py @@ -11,7 +11,7 @@ class IndexCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" config: Required[Config] diff --git a/src/cloudflare/types/vectorize/index_delete_by_ids_params.py b/src/cloudflare/types/vectorize/index_delete_by_ids_params.py index 1b21f4972af..4595f5458f3 100644 --- a/src/cloudflare/types/vectorize/index_delete_by_ids_params.py +++ b/src/cloudflare/types/vectorize/index_delete_by_ids_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class IndexDeleteByIDsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" ids: SequenceNotStr[str] diff --git a/src/cloudflare/types/vectorize/index_get_by_ids_params.py b/src/cloudflare/types/vectorize/index_get_by_ids_params.py index 4ea65a642b4..8024b367604 100644 --- a/src/cloudflare/types/vectorize/index_get_by_ids_params.py +++ b/src/cloudflare/types/vectorize/index_get_by_ids_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class IndexGetByIDsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" ids: SequenceNotStr[str] diff --git a/src/cloudflare/types/vectorize/index_insert_params.py b/src/cloudflare/types/vectorize/index_insert_params.py index 64b357d1b5a..2a793667035 100644 --- a/src/cloudflare/types/vectorize/index_insert_params.py +++ b/src/cloudflare/types/vectorize/index_insert_params.py @@ -11,7 +11,7 @@ class IndexInsertParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[FileTypes] diff --git a/src/cloudflare/types/vectorize/index_list_vectors_params.py b/src/cloudflare/types/vectorize/index_list_vectors_params.py index c41a8ef03c4..5f913ede275 100644 --- a/src/cloudflare/types/vectorize/index_list_vectors_params.py +++ b/src/cloudflare/types/vectorize/index_list_vectors_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IndexListVectorsParams"] class IndexListVectorsParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" count: int diff --git a/src/cloudflare/types/vectorize/index_query_params.py b/src/cloudflare/types/vectorize/index_query_params.py index 2c6c41ccb87..c0c488a2ccf 100644 --- a/src/cloudflare/types/vectorize/index_query_params.py +++ b/src/cloudflare/types/vectorize/index_query_params.py @@ -11,7 +11,7 @@ class IndexQueryParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" vector: Required[Iterable[float]] diff --git a/src/cloudflare/types/vectorize/index_upsert_params.py b/src/cloudflare/types/vectorize/index_upsert_params.py index 9676180dab8..5e7dc3f3b55 100644 --- a/src/cloudflare/types/vectorize/index_upsert_params.py +++ b/src/cloudflare/types/vectorize/index_upsert_params.py @@ -11,7 +11,7 @@ class IndexUpsertParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" body: Required[FileTypes] diff --git a/src/cloudflare/types/vectorize/indexes/metadata_index_create_params.py b/src/cloudflare/types/vectorize/indexes/metadata_index_create_params.py index 341fb90216a..248cd1ceca6 100644 --- a/src/cloudflare/types/vectorize/indexes/metadata_index_create_params.py +++ b/src/cloudflare/types/vectorize/indexes/metadata_index_create_params.py @@ -10,7 +10,7 @@ class MetadataIndexCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" index_type: Required[Annotated[Literal["string", "number", "boolean"], PropertyInfo(alias="indexType")]] diff --git a/src/cloudflare/types/vectorize/indexes/metadata_index_delete_params.py b/src/cloudflare/types/vectorize/indexes/metadata_index_delete_params.py index dc394dc4646..f9783b5a394 100644 --- a/src/cloudflare/types/vectorize/indexes/metadata_index_delete_params.py +++ b/src/cloudflare/types/vectorize/indexes/metadata_index_delete_params.py @@ -10,7 +10,7 @@ class MetadataIndexDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier""" property_name: Required[Annotated[str, PropertyInfo(alias="propertyName")]] diff --git a/src/cloudflare/types/vulnerability_scanner/credential_set_create_params.py b/src/cloudflare/types/vulnerability_scanner/credential_set_create_params.py index 7521f765992..83dc378d0e5 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_set_create_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_set_create_params.py @@ -8,7 +8,7 @@ class CredentialSetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/vulnerability_scanner/credential_set_edit_params.py b/src/cloudflare/types/vulnerability_scanner/credential_set_edit_params.py index fac0df0e24f..0074dd20c81 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_set_edit_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_set_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CredentialSetEditParams"] class CredentialSetEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: str diff --git a/src/cloudflare/types/vulnerability_scanner/credential_set_list_params.py b/src/cloudflare/types/vulnerability_scanner/credential_set_list_params.py index c7de2cec226..79175eeebe4 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_set_list_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_set_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CredentialSetListParams"] class CredentialSetListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/vulnerability_scanner/credential_set_update_params.py b/src/cloudflare/types/vulnerability_scanner/credential_set_update_params.py index bbc9031f034..a49fc957fe4 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_set_update_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_set_update_params.py @@ -8,7 +8,7 @@ class CredentialSetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_create_params.py b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_create_params.py index 85881f654a6..ec87d38ea9b 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_create_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_create_params.py @@ -8,7 +8,7 @@ class CredentialCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" location: Required[Literal["header", "cookie"]] diff --git a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_edit_params.py b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_edit_params.py index 503b346e706..00ba9e37f9c 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_edit_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_edit_params.py @@ -8,7 +8,7 @@ class CredentialEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" credential_set_id: Required[str] diff --git a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_list_params.py b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_list_params.py index 8ae79300af5..842e7618875 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_list_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CredentialListParams"] class CredentialListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_update_params.py b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_update_params.py index cfc91e5489a..9c5a58dc2b0 100644 --- a/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_update_params.py +++ b/src/cloudflare/types/vulnerability_scanner/credential_sets/credential_update_params.py @@ -8,7 +8,7 @@ class CredentialUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" credential_set_id: Required[str] diff --git a/src/cloudflare/types/vulnerability_scanner/scan_create_params.py b/src/cloudflare/types/vulnerability_scanner/scan_create_params.py index 43ff1fed642..e22563278f2 100644 --- a/src/cloudflare/types/vulnerability_scanner/scan_create_params.py +++ b/src/cloudflare/types/vulnerability_scanner/scan_create_params.py @@ -10,7 +10,7 @@ class ScanCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" credential_sets: Required[CredentialSets] diff --git a/src/cloudflare/types/vulnerability_scanner/scan_create_response.py b/src/cloudflare/types/vulnerability_scanner/scan_create_response.py index cfb8e075f06..ed0222779ff 100644 --- a/src/cloudflare/types/vulnerability_scanner/scan_create_response.py +++ b/src/cloudflare/types/vulnerability_scanner/scan_create_response.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel __all__ = [ @@ -21,10 +22,10 @@ "ReportReportTestStepRequestVariableCapture", "ReportReportTestStepResponse", "ReportReportTestStepResponseBody", - "ReportReportTestStepResponseBodyKind", - "ReportReportTestStepResponseBodyUnionMember1", - "ReportReportTestStepResponseBodyUnionMember2", - "ReportReportTestStepResponseBodyUnionMember3", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson", "ReportReportTestPreflightError", ] @@ -123,13 +124,13 @@ class ReportReportTestStepRequest(BaseModel): """Request body, if any.""" -class ReportReportTestStepResponseBodyKind(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound(BaseModel): """No body was received.""" kind: Literal["not_found"] -class ReportReportTestStepResponseBodyUnionMember1(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes(BaseModel): """Body received but unable to read as UTF-8. Raw bytes, base64-encoded.""" contents: str @@ -139,7 +140,7 @@ class ReportReportTestStepResponseBodyUnionMember1(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember2(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText(BaseModel): """Body received as valid UTF-8 text but not valid JSON.""" contents: str @@ -149,7 +150,7 @@ class ReportReportTestStepResponseBodyUnionMember2(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember3(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson(BaseModel): """Body received as valid JSON.""" contents: str @@ -159,11 +160,14 @@ class ReportReportTestStepResponseBodyUnionMember3(BaseModel): truncated: bool -ReportReportTestStepResponseBody: TypeAlias = Union[ - ReportReportTestStepResponseBodyKind, - ReportReportTestStepResponseBodyUnionMember1, - ReportReportTestStepResponseBodyUnionMember2, - ReportReportTestStepResponseBodyUnionMember3, +ReportReportTestStepResponseBody: TypeAlias = Annotated[ + Union[ + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson, + ], + PropertyInfo(discriminator="kind"), ] diff --git a/src/cloudflare/types/vulnerability_scanner/scan_get_response.py b/src/cloudflare/types/vulnerability_scanner/scan_get_response.py index 1f47e2445a9..c76dfd49eed 100644 --- a/src/cloudflare/types/vulnerability_scanner/scan_get_response.py +++ b/src/cloudflare/types/vulnerability_scanner/scan_get_response.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel __all__ = [ @@ -21,10 +22,10 @@ "ReportReportTestStepRequestVariableCapture", "ReportReportTestStepResponse", "ReportReportTestStepResponseBody", - "ReportReportTestStepResponseBodyKind", - "ReportReportTestStepResponseBodyUnionMember1", - "ReportReportTestStepResponseBodyUnionMember2", - "ReportReportTestStepResponseBodyUnionMember3", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson", "ReportReportTestPreflightError", ] @@ -123,13 +124,13 @@ class ReportReportTestStepRequest(BaseModel): """Request body, if any.""" -class ReportReportTestStepResponseBodyKind(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound(BaseModel): """No body was received.""" kind: Literal["not_found"] -class ReportReportTestStepResponseBodyUnionMember1(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes(BaseModel): """Body received but unable to read as UTF-8. Raw bytes, base64-encoded.""" contents: str @@ -139,7 +140,7 @@ class ReportReportTestStepResponseBodyUnionMember1(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember2(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText(BaseModel): """Body received as valid UTF-8 text but not valid JSON.""" contents: str @@ -149,7 +150,7 @@ class ReportReportTestStepResponseBodyUnionMember2(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember3(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson(BaseModel): """Body received as valid JSON.""" contents: str @@ -159,11 +160,14 @@ class ReportReportTestStepResponseBodyUnionMember3(BaseModel): truncated: bool -ReportReportTestStepResponseBody: TypeAlias = Union[ - ReportReportTestStepResponseBodyKind, - ReportReportTestStepResponseBodyUnionMember1, - ReportReportTestStepResponseBodyUnionMember2, - ReportReportTestStepResponseBodyUnionMember3, +ReportReportTestStepResponseBody: TypeAlias = Annotated[ + Union[ + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson, + ], + PropertyInfo(discriminator="kind"), ] diff --git a/src/cloudflare/types/vulnerability_scanner/scan_list_params.py b/src/cloudflare/types/vulnerability_scanner/scan_list_params.py index efe67db5f25..7c7a84a12d2 100644 --- a/src/cloudflare/types/vulnerability_scanner/scan_list_params.py +++ b/src/cloudflare/types/vulnerability_scanner/scan_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ScanListParams"] class ScanListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/vulnerability_scanner/scan_list_response.py b/src/cloudflare/types/vulnerability_scanner/scan_list_response.py index e08e1dc2bd8..cdbaaf3d601 100644 --- a/src/cloudflare/types/vulnerability_scanner/scan_list_response.py +++ b/src/cloudflare/types/vulnerability_scanner/scan_list_response.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel __all__ = [ @@ -21,10 +22,10 @@ "ReportReportTestStepRequestVariableCapture", "ReportReportTestStepResponse", "ReportReportTestStepResponseBody", - "ReportReportTestStepResponseBodyKind", - "ReportReportTestStepResponseBodyUnionMember1", - "ReportReportTestStepResponseBodyUnionMember2", - "ReportReportTestStepResponseBodyUnionMember3", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText", + "ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson", "ReportReportTestPreflightError", ] @@ -123,13 +124,13 @@ class ReportReportTestStepRequest(BaseModel): """Request body, if any.""" -class ReportReportTestStepResponseBodyKind(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound(BaseModel): """No body was received.""" kind: Literal["not_found"] -class ReportReportTestStepResponseBodyUnionMember1(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes(BaseModel): """Body received but unable to read as UTF-8. Raw bytes, base64-encoded.""" contents: str @@ -139,7 +140,7 @@ class ReportReportTestStepResponseBodyUnionMember1(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember2(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText(BaseModel): """Body received as valid UTF-8 text but not valid JSON.""" contents: str @@ -149,7 +150,7 @@ class ReportReportTestStepResponseBodyUnionMember2(BaseModel): truncated: bool -class ReportReportTestStepResponseBodyUnionMember3(BaseModel): +class ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson(BaseModel): """Body received as valid JSON.""" contents: str @@ -159,11 +160,14 @@ class ReportReportTestStepResponseBodyUnionMember3(BaseModel): truncated: bool -ReportReportTestStepResponseBody: TypeAlias = Union[ - ReportReportTestStepResponseBodyKind, - ReportReportTestStepResponseBodyUnionMember1, - ReportReportTestStepResponseBodyUnionMember2, - ReportReportTestStepResponseBodyUnionMember3, +ReportReportTestStepResponseBody: TypeAlias = Annotated[ + Union[ + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseNotFound, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseBytes, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseText, + ReportReportTestStepResponseBodyVulnScannerBOLABodyResponseJson, + ], + PropertyInfo(discriminator="kind"), ] diff --git a/src/cloudflare/types/vulnerability_scanner/target_environment_create_params.py b/src/cloudflare/types/vulnerability_scanner/target_environment_create_params.py index 01391b97788..51369f9d369 100644 --- a/src/cloudflare/types/vulnerability_scanner/target_environment_create_params.py +++ b/src/cloudflare/types/vulnerability_scanner/target_environment_create_params.py @@ -9,7 +9,7 @@ class TargetEnvironmentCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/vulnerability_scanner/target_environment_edit_params.py b/src/cloudflare/types/vulnerability_scanner/target_environment_edit_params.py index 08058a73b09..aeb3d688add 100644 --- a/src/cloudflare/types/vulnerability_scanner/target_environment_edit_params.py +++ b/src/cloudflare/types/vulnerability_scanner/target_environment_edit_params.py @@ -9,7 +9,7 @@ class TargetEnvironmentEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" description: Optional[str] diff --git a/src/cloudflare/types/vulnerability_scanner/target_environment_list_params.py b/src/cloudflare/types/vulnerability_scanner/target_environment_list_params.py index e090fb87f30..8cee1b38f60 100644 --- a/src/cloudflare/types/vulnerability_scanner/target_environment_list_params.py +++ b/src/cloudflare/types/vulnerability_scanner/target_environment_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TargetEnvironmentListParams"] class TargetEnvironmentListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/vulnerability_scanner/target_environment_update_params.py b/src/cloudflare/types/vulnerability_scanner/target_environment_update_params.py index 09c37bbefbd..b4e7d9767d2 100644 --- a/src/cloudflare/types/vulnerability_scanner/target_environment_update_params.py +++ b/src/cloudflare/types/vulnerability_scanner/target_environment_update_params.py @@ -9,7 +9,7 @@ class TargetEnvironmentUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/event_create_params.py b/src/cloudflare/types/waiting_rooms/event_create_params.py index c66143a53ac..06aa816b1f9 100644 --- a/src/cloudflare/types/waiting_rooms/event_create_params.py +++ b/src/cloudflare/types/waiting_rooms/event_create_params.py @@ -9,7 +9,7 @@ class EventCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" event_end_time: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/event_edit_params.py b/src/cloudflare/types/waiting_rooms/event_edit_params.py index b63ae52165f..722535af1fe 100644 --- a/src/cloudflare/types/waiting_rooms/event_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/event_edit_params.py @@ -9,7 +9,7 @@ class EventEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" waiting_room_id: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/event_list_params.py b/src/cloudflare/types/waiting_rooms/event_list_params.py index 201d74d75f7..9e585437ce8 100644 --- a/src/cloudflare/types/waiting_rooms/event_list_params.py +++ b/src/cloudflare/types/waiting_rooms/event_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["EventListParams"] class EventListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" page: float diff --git a/src/cloudflare/types/waiting_rooms/event_update_params.py b/src/cloudflare/types/waiting_rooms/event_update_params.py index 7d43c940930..e56d04d1241 100644 --- a/src/cloudflare/types/waiting_rooms/event_update_params.py +++ b/src/cloudflare/types/waiting_rooms/event_update_params.py @@ -9,7 +9,7 @@ class EventUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" waiting_room_id: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/page_preview_params.py b/src/cloudflare/types/waiting_rooms/page_preview_params.py index ec70a9ff0cf..b79d818e12e 100644 --- a/src/cloudflare/types/waiting_rooms/page_preview_params.py +++ b/src/cloudflare/types/waiting_rooms/page_preview_params.py @@ -8,7 +8,7 @@ class PagePreviewParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" custom_html: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/rule_create_params.py b/src/cloudflare/types/waiting_rooms/rule_create_params.py index 1bf5626169e..541d44450cd 100644 --- a/src/cloudflare/types/waiting_rooms/rule_create_params.py +++ b/src/cloudflare/types/waiting_rooms/rule_create_params.py @@ -8,7 +8,7 @@ class RuleCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" rules: Required[Rules] diff --git a/src/cloudflare/types/waiting_rooms/rule_edit_params.py b/src/cloudflare/types/waiting_rooms/rule_edit_params.py index 81e75d24c5a..b47af6b93f6 100644 --- a/src/cloudflare/types/waiting_rooms/rule_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/rule_edit_params.py @@ -9,7 +9,7 @@ class RuleEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" waiting_room_id: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/rule_update_params.py b/src/cloudflare/types/waiting_rooms/rule_update_params.py index d16432e4dec..2f5cac8b5ba 100644 --- a/src/cloudflare/types/waiting_rooms/rule_update_params.py +++ b/src/cloudflare/types/waiting_rooms/rule_update_params.py @@ -9,7 +9,7 @@ class RuleUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" rules: Required[Iterable[Rule]] diff --git a/src/cloudflare/types/waiting_rooms/setting_edit_params.py b/src/cloudflare/types/waiting_rooms/setting_edit_params.py index 2a3cdafc2da..e51589f9da3 100644 --- a/src/cloudflare/types/waiting_rooms/setting_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/setting_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingEditParams"] class SettingEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" search_engine_crawler_bypass: bool diff --git a/src/cloudflare/types/waiting_rooms/setting_update_params.py b/src/cloudflare/types/waiting_rooms/setting_update_params.py index 39d410db660..8893bea54c3 100644 --- a/src/cloudflare/types/waiting_rooms/setting_update_params.py +++ b/src/cloudflare/types/waiting_rooms/setting_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingUpdateParams"] class SettingUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" search_engine_crawler_bypass: bool diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py index 82b96e2f36c..fecbc179196 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_create_params.py @@ -12,7 +12,7 @@ class WaitingRoomCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" host: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py index 7ca823fd148..77126b1a0aa 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_edit_params.py @@ -12,7 +12,7 @@ class WaitingRoomEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" host: Required[str] diff --git a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py index 96112e5abf8..6e02d3de918 100644 --- a/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py +++ b/src/cloudflare/types/waiting_rooms/waiting_room_update_params.py @@ -12,7 +12,7 @@ class WaitingRoomUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" host: Required[str] diff --git a/src/cloudflare/types/web3/hostname_create_params.py b/src/cloudflare/types/web3/hostname_create_params.py index 656e45304e6..9bba7e142b7 100644 --- a/src/cloudflare/types/web3/hostname_create_params.py +++ b/src/cloudflare/types/web3/hostname_create_params.py @@ -8,7 +8,7 @@ class HostnameCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specify the identifier of the hostname.""" name: Required[str] diff --git a/src/cloudflare/types/web3/hostname_edit_params.py b/src/cloudflare/types/web3/hostname_edit_params.py index 9b1e4e2dbc1..48150e8906a 100644 --- a/src/cloudflare/types/web3/hostname_edit_params.py +++ b/src/cloudflare/types/web3/hostname_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostnameEditParams"] class HostnameEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specify the identifier of the hostname.""" description: str diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py index 9fda437f605..034933f46f6 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_list_update_params.py @@ -9,7 +9,7 @@ class ContentListUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specify the identifier of the hostname.""" action: Required[Literal["block"]] diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_params.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_params.py index 63b9b639ba7..d405fc9ebe5 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_params.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_create_params.py @@ -8,7 +8,7 @@ class EntryCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specify the identifier of the hostname.""" content: Required[str] diff --git a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_params.py b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_params.py index 3a40dcf74fd..e48b25bd067 100644 --- a/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_params.py +++ b/src/cloudflare/types/web3/hostnames/ipfs_universal_paths/content_lists/entry_update_params.py @@ -8,7 +8,7 @@ class EntryUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Specify the identifier of the hostname.""" identifier: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespace_create_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespace_create_params.py index 2ec301cb276..cda0173ef7b 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespace_create_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespace_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["NamespaceCreateParams"] class NamespaceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: str diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_delete_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_delete_params.py index 01fbc554213..e319bb4dd06 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_delete_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_delete_params.py @@ -8,7 +8,7 @@ class ScriptDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] 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 53b6b423ec9..ff2bf226887 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 @@ -78,7 +78,7 @@ class ScriptUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py index cbe0f755011..9371d50af54 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/asset_upload_create_params.py @@ -9,7 +9,7 @@ class AssetUploadCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py index 2bf785834a3..a9e37d435a5 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/content_update_params.py @@ -12,7 +12,7 @@ class ContentUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_delete_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_delete_params.py index be86bc2d495..4ab02ea8f63 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_delete_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_delete_params.py @@ -8,7 +8,7 @@ class SecretDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_get_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_get_params.py index 7ed09305784..f80e8635077 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_get_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_get_params.py @@ -8,7 +8,7 @@ class SecretGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_update_params.py index 2b0a73a4a10..546fbeb728d 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/secret_update_params.py @@ -9,7 +9,7 @@ class WorkersBindingKindSecretText(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] @@ -26,7 +26,7 @@ class WorkersBindingKindSecretText(TypedDict, total=False): class WorkersBindingKindSecretKey(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index 59b2361abbc..f11ee4e853d 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -76,7 +76,7 @@ class SettingEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_params.py index f2bc3c16f65..d7ec6256208 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/tag_update_params.py @@ -11,7 +11,7 @@ class TagUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" dispatch_namespace: Required[str] diff --git a/src/cloudflare/types/workflows/instance_bulk_params.py b/src/cloudflare/types/workflows/instance_bulk_params.py index 660a1602d65..6e306f00583 100644 --- a/src/cloudflare/types/workflows/instance_bulk_params.py +++ b/src/cloudflare/types/workflows/instance_bulk_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["InstanceBulkParams", "Body", "BodyInstanceRetention"] class InstanceBulkParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Iterable[Body] diff --git a/src/cloudflare/types/workflows/instance_create_params.py b/src/cloudflare/types/workflows/instance_create_params.py index 03ea41e3994..15d684fa37e 100644 --- a/src/cloudflare/types/workflows/instance_create_params.py +++ b/src/cloudflare/types/workflows/instance_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Union -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["InstanceCreateParams", "InstanceRetention"] class InstanceCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] instance_id: str diff --git a/src/cloudflare/types/workflows/instance_get_params.py b/src/cloudflare/types/workflows/instance_get_params.py index cd5b2080455..eb22c5965ce 100644 --- a/src/cloudflare/types/workflows/instance_get_params.py +++ b/src/cloudflare/types/workflows/instance_get_params.py @@ -8,7 +8,7 @@ class InstanceGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] workflow_name: Required[str] diff --git a/src/cloudflare/types/workflows/instance_list_params.py b/src/cloudflare/types/workflows/instance_list_params.py index c0239a5e171..113a939233c 100644 --- a/src/cloudflare/types/workflows/instance_list_params.py +++ b/src/cloudflare/types/workflows/instance_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class InstanceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] cursor: str """Opaque token for cursor-based pagination. Mutually exclusive with `page`.""" diff --git a/src/cloudflare/types/workflows/instances/event_create_params.py b/src/cloudflare/types/workflows/instances/event_create_params.py index c9b47fb4ad5..52118424ae5 100644 --- a/src/cloudflare/types/workflows/instances/event_create_params.py +++ b/src/cloudflare/types/workflows/instances/event_create_params.py @@ -8,7 +8,7 @@ class EventCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] workflow_name: Required[str] diff --git a/src/cloudflare/types/workflows/instances/status_edit_params.py b/src/cloudflare/types/workflows/instances/status_edit_params.py index edce6009d3c..e6c966139cd 100644 --- a/src/cloudflare/types/workflows/instances/status_edit_params.py +++ b/src/cloudflare/types/workflows/instances/status_edit_params.py @@ -2,15 +2,30 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict -__all__ = ["StatusEditParams"] +from ...._utils import PropertyInfo + +__all__ = ["StatusEditParams", "From"] class StatusEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] workflow_name: Required[str] status: Required[Literal["resume", "pause", "terminate", "restart"]] """Apply action to instance.""" + + from_: Annotated[From, PropertyInfo(alias="from")] + """Step to restart from. Only applicable when status is "restart".""" + + +class From(TypedDict, total=False): + """Step to restart from. Only applicable when status is "restart".""" + + name: Required[str] + + count: int + + type: Literal["do", "sleep", "waitForEvent"] diff --git a/src/cloudflare/types/workflows/version_list_params.py b/src/cloudflare/types/workflows/version_list_params.py index 2621680c26d..05e3c443227 100644 --- a/src/cloudflare/types/workflows/version_list_params.py +++ b/src/cloudflare/types/workflows/version_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["VersionListParams"] class VersionListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: float diff --git a/src/cloudflare/types/workflows/workflow_list_params.py b/src/cloudflare/types/workflows/workflow_list_params.py index b37f48483cb..8c5c598864e 100644 --- a/src/cloudflare/types/workflows/workflow_list_params.py +++ b/src/cloudflare/types/workflows/workflow_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WorkflowListParams"] class WorkflowListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: float diff --git a/src/cloudflare/types/workflows/workflow_update_params.py b/src/cloudflare/types/workflows/workflow_update_params.py index a360e5711e8..2ff781a484d 100644 --- a/src/cloudflare/types/workflows/workflow_update_params.py +++ b/src/cloudflare/types/workflows/workflow_update_params.py @@ -8,7 +8,7 @@ class WorkflowUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] class_name: Required[str] diff --git a/src/cloudflare/types/zaraz/config_update_params.py b/src/cloudflare/types/zaraz/config_update_params.py index e4176952429..7fa005e627b 100644 --- a/src/cloudflare/types/zaraz/config_update_params.py +++ b/src/cloudflare/types/zaraz/config_update_params.py @@ -60,7 +60,7 @@ class ConfigUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" data_layer: Required[Annotated[bool, PropertyInfo(alias="dataLayer")]] diff --git a/src/cloudflare/types/zaraz/history/config_get_params.py b/src/cloudflare/types/zaraz/history/config_get_params.py index 79669793324..2549133ac3d 100644 --- a/src/cloudflare/types/zaraz/history/config_get_params.py +++ b/src/cloudflare/types/zaraz/history/config_get_params.py @@ -9,7 +9,7 @@ class ConfigGetParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" ids: Required[Iterable[int]] diff --git a/src/cloudflare/types/zaraz/history_list_params.py b/src/cloudflare/types/zaraz/history_list_params.py index e1d91107400..c7b5fb731e6 100644 --- a/src/cloudflare/types/zaraz/history_list_params.py +++ b/src/cloudflare/types/zaraz/history_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -10,7 +10,7 @@ class HistoryListParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" limit: int diff --git a/src/cloudflare/types/zaraz/history_update_params.py b/src/cloudflare/types/zaraz/history_update_params.py index 2b7e48926db..7f6f60d5cff 100644 --- a/src/cloudflare/types/zaraz/history_update_params.py +++ b/src/cloudflare/types/zaraz/history_update_params.py @@ -8,7 +8,7 @@ class HistoryUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: Required[int] diff --git a/src/cloudflare/types/zaraz/publish_create_params.py b/src/cloudflare/types/zaraz/publish_create_params.py index 879affbfab0..574d851996f 100644 --- a/src/cloudflare/types/zaraz/publish_create_params.py +++ b/src/cloudflare/types/zaraz/publish_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PublishCreateParams"] class PublishCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" body: str diff --git a/src/cloudflare/types/zaraz/zaraz_update_params.py b/src/cloudflare/types/zaraz/zaraz_update_params.py index 5bd68188049..5e781b346e3 100644 --- a/src/cloudflare/types/zaraz/zaraz_update_params.py +++ b/src/cloudflare/types/zaraz/zaraz_update_params.py @@ -10,7 +10,7 @@ class ZarazUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" workflow: Required[Workflow] diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_create_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_create_params.py index a0f75248657..19bc795be10 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_create_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_create_params.py @@ -9,7 +9,7 @@ class PortalCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """portal id""" diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_list_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_list_params.py index f85ee9d9fd7..33f5100d91a 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_list_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PortalListParams"] class PortalListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_update_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_update_params.py index fa83cb47438..1bd9dd5b4a7 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_update_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/portal_update_params.py @@ -9,7 +9,7 @@ class PortalUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] allow_code_mode: bool """Allow remote code execution in Dynamic Workers (beta)""" diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_create_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_create_params.py index 258a5f8db78..57c26163547 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_create_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_create_params.py @@ -9,7 +9,7 @@ class ServerCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[str] """server id""" diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_list_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_list_params.py index 70602b65651..139f6ab9bad 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_list_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ServerListParams"] class ServerListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: int diff --git a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_update_params.py b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_update_params.py index 4cf2de448a2..38cf578f571 100644 --- a/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_update_params.py +++ b/src/cloudflare/types/zero_trust/access/ai_controls/mcp/server_update_params.py @@ -9,7 +9,7 @@ class ServerUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] auth_credentials: str diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py index 410342be187..6be89506f1f 100755 --- a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py @@ -21,7 +21,7 @@ class PolicyTestCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" policies: SequenceNotStr[Policy] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py index 03d89d49e6a..a35a3e075c7 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["UserListParams"] class UserListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/zero_trust/access/bookmark_create_params.py b/src/cloudflare/types/zero_trust/access/bookmark_create_params.py index 7c5005a97be..a0278f281d7 100644 --- a/src/cloudflare/types/zero_trust/access/bookmark_create_params.py +++ b/src/cloudflare/types/zero_trust/access/bookmark_create_params.py @@ -8,6 +8,6 @@ class BookmarkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[object] diff --git a/src/cloudflare/types/zero_trust/access/bookmark_update_params.py b/src/cloudflare/types/zero_trust/access/bookmark_update_params.py index 9b9c4e561a9..82a32f4b5e0 100644 --- a/src/cloudflare/types/zero_trust/access/bookmark_update_params.py +++ b/src/cloudflare/types/zero_trust/access/bookmark_update_params.py @@ -8,6 +8,6 @@ class BookmarkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[object] diff --git a/src/cloudflare/types/zero_trust/access/custom_page_create_params.py b/src/cloudflare/types/zero_trust/access/custom_page_create_params.py index 25e1816d8cd..ce8b80d12b5 100644 --- a/src/cloudflare/types/zero_trust/access/custom_page_create_params.py +++ b/src/cloudflare/types/zero_trust/access/custom_page_create_params.py @@ -8,7 +8,7 @@ class CustomPageCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" custom_html: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/custom_page_list_params.py b/src/cloudflare/types/zero_trust/access/custom_page_list_params.py index d01502439ed..2cb0f7545b7 100644 --- a/src/cloudflare/types/zero_trust/access/custom_page_list_params.py +++ b/src/cloudflare/types/zero_trust/access/custom_page_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CustomPageListParams"] class CustomPageListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/zero_trust/access/custom_page_update_params.py b/src/cloudflare/types/zero_trust/access/custom_page_update_params.py index 0ef8ee8a790..1b82f6cf05b 100644 --- a/src/cloudflare/types/zero_trust/access/custom_page_update_params.py +++ b/src/cloudflare/types/zero_trust/access/custom_page_update_params.py @@ -8,7 +8,7 @@ class CustomPageUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" custom_html: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py index 3c57589949e..645b0c9ac78 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_delete_v2_params.py @@ -10,7 +10,7 @@ class TargetBulkDeleteV2Params(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" target_ids: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_params.py index 6a41d2d1c46..df2dd331801 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_bulk_update_params.py @@ -9,7 +9,7 @@ class TargetBulkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_create_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_create_params.py index ee62803e7b8..465af47967d 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_create_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_create_params.py @@ -8,7 +8,7 @@ class TargetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" hostname: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py index 719d45f687b..210b5e5fe2c 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_list_params.py @@ -4,7 +4,7 @@ from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ....._types import SequenceNotStr from ....._utils import PropertyInfo @@ -13,7 +13,7 @@ class TargetListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" created_after: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/zero_trust/access/infrastructure/target_update_params.py b/src/cloudflare/types/zero_trust/access/infrastructure/target_update_params.py index b1ccf2c9819..1728fcc15f3 100644 --- a/src/cloudflare/types/zero_trust/access/infrastructure/target_update_params.py +++ b/src/cloudflare/types/zero_trust/access/infrastructure/target_update_params.py @@ -8,7 +8,7 @@ class TargetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Account identifier""" hostname: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/key_update_params.py b/src/cloudflare/types/zero_trust/access/key_update_params.py index 571f88fb261..8eb5a1c7049 100644 --- a/src/cloudflare/types/zero_trust/access/key_update_params.py +++ b/src/cloudflare/types/zero_trust/access/key_update_params.py @@ -8,7 +8,7 @@ class KeyUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" key_rotation_interval_days: Required[float] diff --git a/src/cloudflare/types/zero_trust/access/logs/access_request_list_params.py b/src/cloudflare/types/zero_trust/access/logs/access_request_list_params.py index c1f4164c41a..c22b8ff0793 100644 --- a/src/cloudflare/types/zero_trust/access/logs/access_request_list_params.py +++ b/src/cloudflare/types/zero_trust/access/logs/access_request_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ....._utils import PropertyInfo @@ -12,7 +12,7 @@ class AccessRequestListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" allowed_op: Annotated[Literal["eq", "neq"], PropertyInfo(alias="allowedOp")] diff --git a/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py index 4612dd9c6e2..6ef5bb55bb5 100644 --- a/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py +++ b/src/cloudflare/types/zero_trust/access/logs/scim/update_list_params.py @@ -13,7 +13,7 @@ class UpdateListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" idp_id: Required[SequenceNotStr[str]] diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index c92ee7af8a7..880b61d6c48 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -13,7 +13,7 @@ class PolicyCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" decision: Required[Decision] diff --git a/src/cloudflare/types/zero_trust/access/policy_list_params.py b/src/cloudflare/types/zero_trust/access/policy_list_params.py index e644aaa5882..81043b62ad6 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["PolicyListParams"] class PolicyListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 06268d2dcb3..57c3cd9cd3a 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -13,7 +13,7 @@ class PolicyUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" decision: Required[Decision] diff --git a/src/cloudflare/types/zero_trust/access/service_token_rotate_params.py b/src/cloudflare/types/zero_trust/access/service_token_rotate_params.py index cb1b7e25555..2fb1017ea1a 100644 --- a/src/cloudflare/types/zero_trust/access/service_token_rotate_params.py +++ b/src/cloudflare/types/zero_trust/access/service_token_rotate_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class ServiceTokenRotateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" previous_client_secret_expires_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/zero_trust/access/tag_create_params.py b/src/cloudflare/types/zero_trust/access/tag_create_params.py index a446d2652ea..91785c49db9 100644 --- a/src/cloudflare/types/zero_trust/access/tag_create_params.py +++ b/src/cloudflare/types/zero_trust/access/tag_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TagCreateParams"] class TagCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: str diff --git a/src/cloudflare/types/zero_trust/access/tag_list_params.py b/src/cloudflare/types/zero_trust/access/tag_list_params.py index 931f00cd432..18e55a02101 100644 --- a/src/cloudflare/types/zero_trust/access/tag_list_params.py +++ b/src/cloudflare/types/zero_trust/access/tag_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["TagListParams"] class TagListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" page: int diff --git a/src/cloudflare/types/zero_trust/access/tag_update_params.py b/src/cloudflare/types/zero_trust/access/tag_update_params.py index 6e1cfbcad82..0a939594f6d 100644 --- a/src/cloudflare/types/zero_trust/access/tag_update_params.py +++ b/src/cloudflare/types/zero_trust/access/tag_update_params.py @@ -8,7 +8,7 @@ class TagUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" name: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/user_create_params.py b/src/cloudflare/types/zero_trust/access/user_create_params.py index 683e9a484a4..dcbedcff9d8 100644 --- a/src/cloudflare/types/zero_trust/access/user_create_params.py +++ b/src/cloudflare/types/zero_trust/access/user_create_params.py @@ -8,7 +8,7 @@ class UserCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" email: Required[str] diff --git a/src/cloudflare/types/zero_trust/access/user_list_params.py b/src/cloudflare/types/zero_trust/access/user_list_params.py index 32538d6b244..98afd06454a 100644 --- a/src/cloudflare/types/zero_trust/access/user_list_params.py +++ b/src/cloudflare/types/zero_trust/access/user_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserListParams"] class UserListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" email: str diff --git a/src/cloudflare/types/zero_trust/access/user_update_params.py b/src/cloudflare/types/zero_trust/access/user_update_params.py index a8c79eea873..8501df104cc 100644 --- a/src/cloudflare/types/zero_trust/access/user_update_params.py +++ b/src/cloudflare/types/zero_trust/access/user_update_params.py @@ -8,7 +8,7 @@ class UserUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" email: Required[str] diff --git a/src/cloudflare/types/zero_trust/connectivity_setting_edit_params.py b/src/cloudflare/types/zero_trust/connectivity_setting_edit_params.py index 78d77113210..22aee0433e8 100644 --- a/src/cloudflare/types/zero_trust/connectivity_setting_edit_params.py +++ b/src/cloudflare/types/zero_trust/connectivity_setting_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ConnectivitySettingEditParams"] class ConnectivitySettingEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" icmp_proxy_enabled: bool diff --git a/src/cloudflare/types/zero_trust/devices/device_get_params.py b/src/cloudflare/types/zero_trust/devices/device_get_params.py index c9711f4283a..c81fa9ea02e 100644 --- a/src/cloudflare/types/zero_trust/devices/device_get_params.py +++ b/src/cloudflare/types/zero_trust/devices/device_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DeviceGetParams"] class DeviceGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] include: str """ diff --git a/src/cloudflare/types/zero_trust/devices/device_list_params.py b/src/cloudflare/types/zero_trust/devices/device_list_params.py index 6691b995f29..8e3b593f846 100644 --- a/src/cloudflare/types/zero_trust/devices/device_list_params.py +++ b/src/cloudflare/types/zero_trust/devices/device_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class DeviceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: SequenceNotStr[str] """Filter by a one or more device IDs.""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py index 552dcdb3e2b..8cb648370a6 100644 --- a/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/dex_test_create_params.py @@ -9,7 +9,7 @@ class DEXTestCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] data: Required[Data] """ diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_list_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_list_params.py index 8d970e815d5..6a0abe911f6 100644 --- a/src/cloudflare/types/zero_trust/devices/dex_test_list_params.py +++ b/src/cloudflare/types/zero_trust/devices/dex_test_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -10,7 +10,7 @@ class DEXTestListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] kind: Literal["http", "traceroute"] """Filter by test type""" diff --git a/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py index b9c272fc9c4..9f4c11b91f7 100644 --- a/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/dex_test_update_params.py @@ -9,7 +9,7 @@ class DEXTestUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] data: Required[Data] """ diff --git a/src/cloudflare/types/zero_trust/devices/fleet_status_get_params.py b/src/cloudflare/types/zero_trust/devices/fleet_status_get_params.py index 0150564db3f..09a81b98c51 100644 --- a/src/cloudflare/types/zero_trust/devices/fleet_status_get_params.py +++ b/src/cloudflare/types/zero_trust/devices/fleet_status_get_params.py @@ -8,7 +8,7 @@ class FleetStatusGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] since_minutes: Required[float] """Number of minutes before current time""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py index 420c2111746..60ab6588144 100644 --- a/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py @@ -9,7 +9,7 @@ class IPProfileCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] match: Required[str] """The wirefilter expression to match registrations. diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py index 91214396f60..184eba34c9b 100644 --- a/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IPProfileListParams"] class IPProfileListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] per_page: int """The number of IP profiles to return per page.""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py index d948f84418e..793212497f8 100644 --- a/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IPProfileUpdateParams"] class IPProfileUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: str """An optional description of the Device IP profile.""" diff --git a/src/cloudflare/types/zero_trust/devices/network_create_params.py b/src/cloudflare/types/zero_trust/devices/network_create_params.py index fb82d096ee0..482bde1c2e7 100644 --- a/src/cloudflare/types/zero_trust/devices/network_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_create_params.py @@ -8,7 +8,7 @@ class NetworkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] config: Required[Config] """ diff --git a/src/cloudflare/types/zero_trust/devices/network_update_params.py b/src/cloudflare/types/zero_trust/devices/network_update_params.py index bbbbc52ff21..b85625ef578 100644 --- a/src/cloudflare/types/zero_trust/devices/network_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/network_update_params.py @@ -8,7 +8,7 @@ class NetworkUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] config: Config """ diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_params.py index 2db57a8cb1a..3bdc54c4c9f 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom/exclude_update_params.py @@ -11,6 +11,6 @@ class ExcludeUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[Iterable[SplitTunnelExcludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_params.py index 643d80dd6b4..2c284e47aee 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom/fallback_domain_update_params.py @@ -11,6 +11,6 @@ class FallbackDomainUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] domains: Required[Iterable[FallbackDomainParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_params.py index 771825e4380..6568d4ef985 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom/include_update_params.py @@ -11,6 +11,6 @@ class IncludeUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[Iterable[SplitTunnelIncludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py index 2d407e89019..d2302201175 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py @@ -12,7 +12,7 @@ class CustomCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] match: Required[str] """The wirefilter expression to match devices. diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py index 05af477c3b8..85e7e19bd3c 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..split_tunnel_exclude_param import SplitTunnelExcludeParam from ..split_tunnel_include_param import SplitTunnelIncludeParam @@ -12,7 +12,7 @@ class CustomEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] allow_mode_switch: bool """Whether to allow the user to switch WARP between modes.""" diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_params.py index baa65057b57..5660da8891b 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/certificate_edit_params.py @@ -8,7 +8,7 @@ class CertificateEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] enabled: Required[bool] """ diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_params.py index 2db57a8cb1a..3bdc54c4c9f 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/exclude_update_params.py @@ -11,6 +11,6 @@ class ExcludeUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[Iterable[SplitTunnelExcludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_params.py index 643d80dd6b4..2c284e47aee 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/fallback_domain_update_params.py @@ -11,6 +11,6 @@ class FallbackDomainUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] domains: Required[Iterable[FallbackDomainParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default/include_update_params.py b/src/cloudflare/types/zero_trust/devices/policies/default/include_update_params.py index 771825e4380..6568d4ef985 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default/include_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default/include_update_params.py @@ -11,6 +11,6 @@ class IncludeUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[Iterable[SplitTunnelIncludeParam]] diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py index 9aab6b426e2..9a6b533464c 100644 --- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ..split_tunnel_exclude_param import SplitTunnelExcludeParam from ..split_tunnel_include_param import SplitTunnelIncludeParam @@ -12,7 +12,7 @@ class DefaultEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] allow_mode_switch: bool """Whether to allow the user to switch WARP between modes.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration_create_params.py b/src/cloudflare/types/zero_trust/devices/posture/integration_create_params.py index c7fd4445570..00121f538be 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration_create_params.py @@ -20,7 +20,7 @@ class IntegrationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] config: Required[Config] """The configuration object containing third-party integration information.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture/integration_edit_params.py b/src/cloudflare/types/zero_trust/devices/posture/integration_edit_params.py index b9a0dca3cad..c23e0af1787 100644 --- a/src/cloudflare/types/zero_trust/devices/posture/integration_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/posture/integration_edit_params.py @@ -20,7 +20,7 @@ class IntegrationEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] config: Config """The configuration object containing third-party integration information.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture_create_params.py b/src/cloudflare/types/zero_trust/devices/posture_create_params.py index 24fd77b0c48..1d923fd3fac 100644 --- a/src/cloudflare/types/zero_trust/devices/posture_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/posture_create_params.py @@ -12,7 +12,7 @@ class PostureCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """The name of the device posture rule.""" diff --git a/src/cloudflare/types/zero_trust/devices/posture_update_params.py b/src/cloudflare/types/zero_trust/devices/posture_update_params.py index a1e477c7be3..dbb5308e3a7 100644 --- a/src/cloudflare/types/zero_trust/devices/posture_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/posture_update_params.py @@ -12,7 +12,7 @@ class PostureUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """The name of the device posture rule.""" diff --git a/src/cloudflare/types/zero_trust/devices/registration_bulk_delete_params.py b/src/cloudflare/types/zero_trust/devices/registration_bulk_delete_params.py index 39fbaeb052b..bcca1ca09a6 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_bulk_delete_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_bulk_delete_params.py @@ -10,7 +10,7 @@ class RegistrationBulkDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[SequenceNotStr[str]] """A list of registration IDs to delete.""" diff --git a/src/cloudflare/types/zero_trust/devices/registration_get_params.py b/src/cloudflare/types/zero_trust/devices/registration_get_params.py index 9b7e47ef8e8..fa02ad65420 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_get_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RegistrationGetParams"] class RegistrationGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] include: str """ diff --git a/src/cloudflare/types/zero_trust/devices/registration_list_params.py b/src/cloudflare/types/zero_trust/devices/registration_list_params.py index 8e729ac067e..a8cc4ebe404 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_list_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ...._types import SequenceNotStr @@ -10,7 +10,7 @@ class RegistrationListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: SequenceNotStr[str] """Filter by registration ID.""" diff --git a/src/cloudflare/types/zero_trust/devices/registration_revoke_params.py b/src/cloudflare/types/zero_trust/devices/registration_revoke_params.py index bafa35f0dbf..8f93798909d 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_revoke_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_revoke_params.py @@ -10,7 +10,7 @@ class RegistrationRevokeParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[SequenceNotStr[str]] """A list of registration IDs to revoke.""" diff --git a/src/cloudflare/types/zero_trust/devices/registration_unrevoke_params.py b/src/cloudflare/types/zero_trust/devices/registration_unrevoke_params.py index 0e40f547f39..d94490cb4b6 100644 --- a/src/cloudflare/types/zero_trust/devices/registration_unrevoke_params.py +++ b/src/cloudflare/types/zero_trust/devices/registration_unrevoke_params.py @@ -10,7 +10,7 @@ class RegistrationUnrevokeParams(TypedDict, total=False): - account_id: str + account_id: Required[str] id: Required[SequenceNotStr[str]] """A list of registration IDs to unrevoke.""" diff --git a/src/cloudflare/types/zero_trust/devices/resilience/global_warp_override_create_params.py b/src/cloudflare/types/zero_trust/devices/resilience/global_warp_override_create_params.py index c0100344a90..362f206b71e 100644 --- a/src/cloudflare/types/zero_trust/devices/resilience/global_warp_override_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/resilience/global_warp_override_create_params.py @@ -8,7 +8,7 @@ class GlobalWARPOverrideCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] disconnect: Required[bool] """Disconnects all devices on the account using Global WARP override.""" diff --git a/src/cloudflare/types/zero_trust/devices/revoke_create_params.py b/src/cloudflare/types/zero_trust/devices/revoke_create_params.py index badc4356567..c418c69dbd4 100644 --- a/src/cloudflare/types/zero_trust/devices/revoke_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/revoke_create_params.py @@ -10,7 +10,7 @@ class RevokeCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[SequenceNotStr[str]] """A list of Registration IDs to revoke.""" diff --git a/src/cloudflare/types/zero_trust/devices/setting_edit_params.py b/src/cloudflare/types/zero_trust/devices/setting_edit_params.py index 89a0af28640..2516e80cc9f 100755 --- a/src/cloudflare/types/zero_trust/devices/setting_edit_params.py +++ b/src/cloudflare/types/zero_trust/devices/setting_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingEditParams"] class SettingEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] disable_for_time: float """ diff --git a/src/cloudflare/types/zero_trust/devices/setting_update_params.py b/src/cloudflare/types/zero_trust/devices/setting_update_params.py index f7d697d11be..2cb606e33b5 100644 --- a/src/cloudflare/types/zero_trust/devices/setting_update_params.py +++ b/src/cloudflare/types/zero_trust/devices/setting_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["SettingUpdateParams"] class SettingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] disable_for_time: float """ diff --git a/src/cloudflare/types/zero_trust/devices/unrevoke_create_params.py b/src/cloudflare/types/zero_trust/devices/unrevoke_create_params.py index 9eaf7df3f08..bdb31360c3c 100644 --- a/src/cloudflare/types/zero_trust/devices/unrevoke_create_params.py +++ b/src/cloudflare/types/zero_trust/devices/unrevoke_create_params.py @@ -10,7 +10,7 @@ class UnrevokeCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[SequenceNotStr[str]] """A list of Registration IDs to unrevoke.""" diff --git a/src/cloudflare/types/zero_trust/dex/colo_list_params.py b/src/cloudflare/types/zero_trust/dex/colo_list_params.py index 2625ebb785b..c208fcae20f 100644 --- a/src/cloudflare/types/zero_trust/dex/colo_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/colo_list_params.py @@ -10,7 +10,7 @@ class ColoListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for connection period in ISO (RFC3339 - ISO 8601) format""" diff --git a/src/cloudflare/types/zero_trust/dex/command_create_params.py b/src/cloudflare/types/zero_trust/dex/command_create_params.py index 39e3a1a5682..a118d017e6d 100644 --- a/src/cloudflare/types/zero_trust/dex/command_create_params.py +++ b/src/cloudflare/types/zero_trust/dex/command_create_params.py @@ -11,7 +11,7 @@ class CommandCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] commands: Required[Iterable[Command]] """List of device-level commands to execute""" diff --git a/src/cloudflare/types/zero_trust/dex/command_list_params.py b/src/cloudflare/types/zero_trust/dex/command_list_params.py index 09735f0c677..cbe58116f27 100644 --- a/src/cloudflare/types/zero_trust/dex/command_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/command_list_params.py @@ -12,7 +12,7 @@ class CommandListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: Required[float] """Page number for pagination""" diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py index f5e8326e9ee..126d1a8cb20 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/commands/device_list_params.py @@ -8,7 +8,7 @@ class DeviceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: Required[float] """Page number of paginated results""" diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_params.py b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_params.py index 48759bfa68c..2e4d8182f1b 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_params.py @@ -10,7 +10,7 @@ class DeviceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Time range beginning in ISO format""" diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status_live_params.py b/src/cloudflare/types/zero_trust/dex/fleet_status_live_params.py index 654db032d61..3f30049cf2d 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status_live_params.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status_live_params.py @@ -8,7 +8,7 @@ class FleetStatusLiveParams(TypedDict, total=False): - account_id: str + account_id: Required[str] since_minutes: Required[float] """Number of minutes before current time""" diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status_over_time_params.py b/src/cloudflare/types/zero_trust/dex/fleet_status_over_time_params.py index bb30c840f2e..662cf4e307c 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status_over_time_params.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status_over_time_params.py @@ -10,7 +10,7 @@ class FleetStatusOverTimeParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Time range beginning in ISO format""" diff --git a/src/cloudflare/types/zero_trust/dex/http_test_get_params.py b/src/cloudflare/types/zero_trust/dex/http_test_get_params.py index 00dd9312acc..0ebbb588734 100644 --- a/src/cloudflare/types/zero_trust/dex/http_test_get_params.py +++ b/src/cloudflare/types/zero_trust/dex/http_test_get_params.py @@ -11,7 +11,7 @@ class HTTPTestGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for aggregate metrics in ISO ms""" diff --git a/src/cloudflare/types/zero_trust/dex/http_tests/percentile_get_params.py b/src/cloudflare/types/zero_trust/dex/http_tests/percentile_get_params.py index 210f0c728e7..393e611ad5e 100644 --- a/src/cloudflare/types/zero_trust/dex/http_tests/percentile_get_params.py +++ b/src/cloudflare/types/zero_trust/dex/http_tests/percentile_get_params.py @@ -11,7 +11,7 @@ class PercentileGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for the query in ISO (RFC3339 - ISO 8601) format""" diff --git a/src/cloudflare/types/zero_trust/dex/rule_create_params.py b/src/cloudflare/types/zero_trust/dex/rule_create_params.py index b5f8d24b83a..db10c6a7be7 100644 --- a/src/cloudflare/types/zero_trust/dex/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/dex/rule_create_params.py @@ -8,7 +8,7 @@ class RuleCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] match: Required[str] """The wirefilter expression to match.""" diff --git a/src/cloudflare/types/zero_trust/dex/rule_list_params.py b/src/cloudflare/types/zero_trust/dex/rule_list_params.py index 63acdee7e4b..f7a59482cd0 100644 --- a/src/cloudflare/types/zero_trust/dex/rule_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/rule_list_params.py @@ -8,7 +8,7 @@ class RuleListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] page: Required[float] """Page number of paginated results""" diff --git a/src/cloudflare/types/zero_trust/dex/rule_update_params.py b/src/cloudflare/types/zero_trust/dex/rule_update_params.py index 0f007cc4ba9..4bafbd979b1 100644 --- a/src/cloudflare/types/zero_trust/dex/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/dex/rule_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RuleUpdateParams"] class RuleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] description: str diff --git a/src/cloudflare/types/zero_trust/dex/test_list_params.py b/src/cloudflare/types/zero_trust/dex/test_list_params.py index 765d40018da..eeadc12677d 100644 --- a/src/cloudflare/types/zero_trust/dex/test_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/test_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._types import SequenceNotStr from ...._utils import PropertyInfo @@ -11,7 +11,7 @@ class TestListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] colo: str """Optionally filter result stats to a Cloudflare colo. diff --git a/src/cloudflare/types/zero_trust/dex/tests/unique_device_list_params.py b/src/cloudflare/types/zero_trust/dex/tests/unique_device_list_params.py index cb9d339cd1d..6aae8692406 100644 --- a/src/cloudflare/types/zero_trust/dex/tests/unique_device_list_params.py +++ b/src/cloudflare/types/zero_trust/dex/tests/unique_device_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ....._types import SequenceNotStr from ....._utils import PropertyInfo @@ -11,7 +11,7 @@ class UniqueDeviceListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] device_id: Annotated[SequenceNotStr[str], PropertyInfo(alias="deviceId")] """Optionally filter result stats to a specific device(s). diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_get_params.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_get_params.py index 7b620a7f3b0..912f057de27 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_get_params.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_get_params.py @@ -11,7 +11,7 @@ class TracerouteTestGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for aggregate metrics in ISO ms""" diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path_params.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path_params.py index b45a8088649..b6ffc3f49e0 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path_params.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_network_path_params.py @@ -10,7 +10,7 @@ class TracerouteTestNetworkPathParams(TypedDict, total=False): - account_id: str + account_id: Required[str] device_id: Required[Annotated[str, PropertyInfo(alias="deviceId")]] """Device to filter tracroute result runs to""" diff --git a/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_params.py b/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_params.py index aef8d037e5d..7c6a8511b34 100644 --- a/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_params.py +++ b/src/cloudflare/types/zero_trust/dex/traceroute_test_percentiles_params.py @@ -11,7 +11,7 @@ class TracerouteTestPercentilesParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for the query in ISO (RFC3339 - ISO 8601) format""" diff --git a/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py index 19c8db30c0a..33c691637a0 100644 --- a/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py +++ b/src/cloudflare/types/zero_trust/dex/warp_change_event_get_params.py @@ -10,7 +10,7 @@ class WARPChangeEventGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] from_: Required[Annotated[str, PropertyInfo(alias="from")]] """Start time for the query in ISO (RFC3339 - ISO 8601) format""" diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_create_params.py b/src/cloudflare/types/zero_trust/dlp/dataset_create_params.py index 18aa16a47dc..ebf338df37d 100644 --- a/src/cloudflare/types/zero_trust/dlp/dataset_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/dataset_create_params.py @@ -9,7 +9,7 @@ class DatasetCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_update_params.py b/src/cloudflare/types/zero_trust/dlp/dataset_update_params.py index 058af5acc78..e372f053cc5 100644 --- a/src/cloudflare/types/zero_trust/dlp/dataset_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/dataset_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DatasetUpdateParams"] class DatasetUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] case_sensitive: bool """Determines if the words should be matched in a case-sensitive manner. diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py index bb4e16f3e97..d0dc07005e5 100644 --- a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_params.py @@ -8,6 +8,6 @@ class UploadEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] dataset_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py index dba758785d2..f08ed008a8f 100755 --- a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py @@ -9,7 +9,7 @@ class VersionCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] dataset_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py index 7c8194bf019..cee7c6bbd09 100755 --- a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py @@ -8,7 +8,7 @@ class EntryCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] dataset_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py index 456655f7a66..a45d1167bd9 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/account_mapping_create_params.py @@ -11,7 +11,7 @@ class AccountMappingCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] auth_requirements: Required[AuthRequirements] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py index fbc51160a5b..bd76fa7aa29 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_bulk_edit_params.py @@ -9,6 +9,6 @@ class RuleBulkEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] new_priorities: Required[Dict[str, int]] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py index 6c569509382..0da93ecb30f 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_create_params.py @@ -11,7 +11,7 @@ class RuleCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] action: Required[Action] diff --git a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py index 8d1a76ee0f7..8f0da8d978b 100644 --- a/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/email/rule_update_params.py @@ -11,7 +11,7 @@ class RuleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] action: Required[Action] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py index ab4901f167f..8700d3d8469 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py @@ -11,7 +11,7 @@ class CustomCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py index a6d618a292f..c6e957d80d3 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py @@ -11,7 +11,7 @@ class CustomUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/integration_create_params.py b/src/cloudflare/types/zero_trust/dlp/entries/integration_create_params.py index 8f7d5865400..ad70062920b 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/integration_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/integration_create_params.py @@ -9,7 +9,7 @@ class IntegrationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/integration_update_params.py b/src/cloudflare/types/zero_trust/dlp/entries/integration_update_params.py index 39b842cbf36..a17458b6ae0 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/integration_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/integration_update_params.py @@ -8,6 +8,6 @@ class IntegrationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_params.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_params.py index 9d6921694bf..92446899f90 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_params.py @@ -9,7 +9,7 @@ class PredefinedCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_params.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_params.py index 326e3c0e8d2..d38e07163d7 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_params.py @@ -8,6 +8,6 @@ class PredefinedUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entry_create_params.py b/src/cloudflare/types/zero_trust/dlp/entry_create_params.py index afd25aa535a..6b6c3364021 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_create_params.py @@ -11,7 +11,7 @@ class EntryCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py index 69c57d42868..04a45767afe 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py @@ -11,7 +11,7 @@ class Variant0(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] @@ -25,7 +25,7 @@ class Variant0(TypedDict, total=False): class Variant1(TypedDict, total=False): - account_id: str + account_id: Required[str] type: Required[Literal["predefined"]] @@ -33,7 +33,7 @@ class Variant1(TypedDict, total=False): class Variant2(TypedDict, total=False): - account_id: str + account_id: Required[str] type: Required[Literal["integration"]] diff --git a/src/cloudflare/types/zero_trust/dlp/pattern_validate_params.py b/src/cloudflare/types/zero_trust/dlp/pattern_validate_params.py index c2b4db8cb20..edd77e78e03 100644 --- a/src/cloudflare/types/zero_trust/dlp/pattern_validate_params.py +++ b/src/cloudflare/types/zero_trust/dlp/pattern_validate_params.py @@ -9,7 +9,7 @@ class PatternValidateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] regex: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py b/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py index 5f17c63f1eb..03c7029235e 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PayloadLogUpdateParams"] class PayloadLogUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] masking_level: Literal["full", "partial", "clear", "default"] """Masking level for payload logs. diff --git a/src/cloudflare/types/zero_trust/dlp/profile_list_params.py b/src/cloudflare/types/zero_trust/dlp/profile_list_params.py index afe648ac7ec..861653b1128 100755 --- a/src/cloudflare/types/zero_trust/dlp/profile_list_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profile_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ProfileListParams"] class ProfileListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] all: bool """ diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py index aefd0b83b30..72c03184d69 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py @@ -20,7 +20,7 @@ class CustomCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py index a8a3c6bf523..a426c95bff5 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py @@ -20,7 +20,7 @@ class CustomUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py index fbacb4fe569..9b25d9eaef5 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py @@ -11,7 +11,7 @@ class PredefinedUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] ai_context_enabled: bool diff --git a/src/cloudflare/types/zero_trust/dlp/setting_edit_params.py b/src/cloudflare/types/zero_trust/dlp/setting_edit_params.py index fb8e430a40a..b415c70e637 100644 --- a/src/cloudflare/types/zero_trust/dlp/setting_edit_params.py +++ b/src/cloudflare/types/zero_trust/dlp/setting_edit_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SettingEditParams", "PayloadLogging"] class SettingEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] ai_context_analysis: Optional[bool] """Whether AI context analysis is enabled at the account level.""" diff --git a/src/cloudflare/types/zero_trust/dlp/setting_update_params.py b/src/cloudflare/types/zero_trust/dlp/setting_update_params.py index 4ebe720f0cb..55f210844bb 100644 --- a/src/cloudflare/types/zero_trust/dlp/setting_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/setting_update_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SettingUpdateParams", "PayloadLogging"] class SettingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] ai_context_analysis: Optional[bool] """Whether AI context analysis is enabled at the account level.""" diff --git a/src/cloudflare/types/zero_trust/gateway/audit_ssh_setting_update_params.py b/src/cloudflare/types/zero_trust/gateway/audit_ssh_setting_update_params.py index 865a8563fcf..2cf5b52ec81 100644 --- a/src/cloudflare/types/zero_trust/gateway/audit_ssh_setting_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/audit_ssh_setting_update_params.py @@ -8,7 +8,7 @@ class AuditSSHSettingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] public_key: Required[str] """Provide the Base64-encoded HPKE public key that encrypts SSH session logs. diff --git a/src/cloudflare/types/zero_trust/gateway/certificate_activate_params.py b/src/cloudflare/types/zero_trust/gateway/certificate_activate_params.py index 92b93714483..a3b1cfe0f98 100644 --- a/src/cloudflare/types/zero_trust/gateway/certificate_activate_params.py +++ b/src/cloudflare/types/zero_trust/gateway/certificate_activate_params.py @@ -8,6 +8,6 @@ class CertificateActivateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[object] diff --git a/src/cloudflare/types/zero_trust/gateway/certificate_create_params.py b/src/cloudflare/types/zero_trust/gateway/certificate_create_params.py index d7e6e663dac..b88ce811bc9 100644 --- a/src/cloudflare/types/zero_trust/gateway/certificate_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/certificate_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CertificateCreateParams"] class CertificateCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] validity_period_days: int """Sets the certificate validity period in days (range: 1-10,950 days / ~30 years). diff --git a/src/cloudflare/types/zero_trust/gateway/certificate_deactivate_params.py b/src/cloudflare/types/zero_trust/gateway/certificate_deactivate_params.py index 473d3572a43..c938aee6c9b 100644 --- a/src/cloudflare/types/zero_trust/gateway/certificate_deactivate_params.py +++ b/src/cloudflare/types/zero_trust/gateway/certificate_deactivate_params.py @@ -8,6 +8,6 @@ class CertificateDeactivateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] body: Required[object] diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py index f97e59958d3..a0c4d70d7aa 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .gateway_configuration_settings_param import GatewayConfigurationSettingsParam @@ -10,7 +10,7 @@ class ConfigurationEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] settings: GatewayConfigurationSettingsParam """Specify account settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py index 21d12f7c7d0..8c3f25cf55e 100644 --- a/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/configuration_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .gateway_configuration_settings_param import GatewayConfigurationSettingsParam @@ -10,7 +10,7 @@ class ConfigurationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] settings: GatewayConfigurationSettingsParam """Specify account settings.""" diff --git a/src/cloudflare/types/zero_trust/gateway/gateway_list.py b/src/cloudflare/types/zero_trust/gateway/gateway_list.py index 5051ff743cb..02ceb52079b 100644 --- a/src/cloudflare/types/zero_trust/gateway/gateway_list.py +++ b/src/cloudflare/types/zero_trust/gateway/gateway_list.py @@ -28,7 +28,7 @@ class GatewayList(BaseModel): name: Optional[str] = None """Specify the list name.""" - type: Optional[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"]] = None + type: Optional[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"]] = None """Specify the list type.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/list_create_params.py b/src/cloudflare/types/zero_trust/gateway/list_create_params.py index aee65050a6b..d870a831a13 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_create_params.py @@ -9,12 +9,12 @@ class ListCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """Specify the list name.""" - type: Required[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"]] + type: Required[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"]] """Specify the list type.""" description: str diff --git a/src/cloudflare/types/zero_trust/gateway/list_create_response.py b/src/cloudflare/types/zero_trust/gateway/list_create_response.py index 0aa554d4b58..96e72c4c388 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_create_response.py +++ b/src/cloudflare/types/zero_trust/gateway/list_create_response.py @@ -25,7 +25,7 @@ class ListCreateResponse(BaseModel): name: Optional[str] = None """Specify the list name.""" - type: Optional[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"]] = None + type: Optional[Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"]] = None """Specify the list type.""" updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py index aebac4e6132..7a5444a78cb 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr @@ -11,7 +11,7 @@ class ListEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] append: Iterable[Append] """Add items to the list.""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_list_params.py b/src/cloudflare/types/zero_trust/gateway/list_list_params.py index 5d15d3a75fe..bc1c75c56d5 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_list_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["ListListParams"] class ListListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] - type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE"] + type: Literal["SERIAL", "URL", "DOMAIN", "EMAIL", "IP", "CATEGORY", "LOCATION", "DEVICE", "AAGUID"] """Specify the list type.""" diff --git a/src/cloudflare/types/zero_trust/gateway/list_update_params.py b/src/cloudflare/types/zero_trust/gateway/list_update_params.py index 5557340be66..bcca5a2f5fe 100644 --- a/src/cloudflare/types/zero_trust/gateway/list_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/list_update_params.py @@ -9,7 +9,7 @@ class ListUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """Specify the list name.""" diff --git a/src/cloudflare/types/zero_trust/gateway/location_create_params.py b/src/cloudflare/types/zero_trust/gateway/location_create_params.py index d3e9f47d878..f20f9f2845a 100644 --- a/src/cloudflare/types/zero_trust/gateway/location_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/location_create_params.py @@ -11,7 +11,7 @@ class LocationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """Specify the location name.""" diff --git a/src/cloudflare/types/zero_trust/gateway/location_update_params.py b/src/cloudflare/types/zero_trust/gateway/location_update_params.py index 6acbf843af8..b374d0096a0 100644 --- a/src/cloudflare/types/zero_trust/gateway/location_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/location_update_params.py @@ -11,7 +11,7 @@ class LocationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """Specify the location name.""" diff --git a/src/cloudflare/types/zero_trust/gateway/logging_update_params.py b/src/cloudflare/types/zero_trust/gateway/logging_update_params.py index cb25a1ccd5f..9adfdbf29e4 100644 --- a/src/cloudflare/types/zero_trust/gateway/logging_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/logging_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = [ "LoggingUpdateParams", @@ -14,7 +14,7 @@ class LoggingUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] redact_pii: bool """ diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py b/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py index 929bada1461..e37e43b96b1 100644 --- a/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py @@ -8,7 +8,7 @@ class PacfileCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] contents: Required[str] """Actual contents of the PAC file""" diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py b/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py index 61ec547ed7c..60f44fe4a85 100644 --- a/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py @@ -8,7 +8,7 @@ class PacfileUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] contents: Required[str] """Actual contents of the PAC file""" diff --git a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_create_params.py b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_create_params.py index beb9a69ec02..344ef9e7c9c 100644 --- a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_create_params.py @@ -13,7 +13,7 @@ class ZeroTrustGatewayProxyEndpointIPCreate(TypedDict, total=False): - account_id: str + account_id: Required[str] name: Required[str] """Specify the name of the proxy endpoint.""" @@ -23,7 +23,7 @@ class ZeroTrustGatewayProxyEndpointIPCreate(TypedDict, total=False): class ZeroTrustGatewayProxyEndpointIdentityCreate(TypedDict, total=False): - account_id: str + account_id: Required[str] kind: Required[Literal["identity"]] """The proxy endpoint kind""" diff --git a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_edit_params.py b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_edit_params.py index 1225cd9f3ab..b986f7f9480 100644 --- a/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_edit_params.py +++ b/src/cloudflare/types/zero_trust/gateway/proxy_endpoint_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from ...._types import SequenceNotStr from .gateway_ips import GatewayIPs @@ -11,7 +11,7 @@ class ProxyEndpointEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] ips: SequenceNotStr[GatewayIPs] """Specify the list of CIDRs to restrict ingress connections.""" diff --git a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py index a249c58ce57..f3bf649d539 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_create_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_create_params.py @@ -15,7 +15,7 @@ class RuleCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] action: Required[ Literal[ diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting.py b/src/cloudflare/types/zero_trust/gateway/rule_setting.py index 4d9f97e1d55..f35a853629b 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting.py @@ -64,8 +64,8 @@ class BISOAdminControls(BaseModel): download: Optional[Literal["enabled", "disabled", "remote_only"]] = None """Configure download behavior. - When set to remote_only, users can view downloads but cannot save them. Applies - only when version == "v2". + When set to remote_only, users can view downloads but cannot save them. If this + field is absent, downloading remains enabled. Applies only when version == "v2". """ dp: Optional[bool] = None @@ -105,6 +105,12 @@ class BISOAdminControls(BaseModel): version: Optional[Literal["v1", "v2"]] = None """Indicate which version of the browser isolation controls should apply.""" + wm_id: Optional[str] = None + """Specify the watermark ID (UUID) to apply to the isolated browser session. + + When present, enables watermark rendering in the isolated browser. + """ + class BlockPage(BaseModel): """Configure custom block page settings. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py index 415870cae73..7303c240398 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_setting_param.py @@ -64,8 +64,8 @@ class BISOAdminControls(TypedDict, total=False): download: Literal["enabled", "disabled", "remote_only"] """Configure download behavior. - When set to remote_only, users can view downloads but cannot save them. Applies - only when version == "v2". + When set to remote_only, users can view downloads but cannot save them. If this + field is absent, downloading remains enabled. Applies only when version == "v2". """ dp: bool @@ -105,6 +105,12 @@ class BISOAdminControls(TypedDict, total=False): version: Literal["v1", "v2"] """Indicate which version of the browser isolation controls should apply.""" + wm_id: str + """Specify the watermark ID (UUID) to apply to the isolated browser session. + + When present, enables watermark rendering in the isolated browser. + """ + class BlockPage(TypedDict, total=False): """Configure custom block page settings. diff --git a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py index bc9e2086650..cb1c5873581 100644 --- a/src/cloudflare/types/zero_trust/gateway/rule_update_params.py +++ b/src/cloudflare/types/zero_trust/gateway/rule_update_params.py @@ -15,7 +15,7 @@ class RuleUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] action: Required[ Literal[ diff --git a/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py b/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py index 4a7068c50f1..c94b4b175b1 100644 --- a/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py +++ b/src/cloudflare/types/zero_trust/identity_providers/scim/group_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["GroupListParams"] class GroupListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cf_resource_id: str diff --git a/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py b/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py index 77efd5bcb06..6ce2445eec1 100644 --- a/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py +++ b/src/cloudflare/types/zero_trust/identity_providers/scim/user_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["UserListParams"] class UserListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" cf_resource_id: str diff --git a/src/cloudflare/types/zero_trust/networks/hostname_route_create_params.py b/src/cloudflare/types/zero_trust/networks/hostname_route_create_params.py index 376549012c0..cf16e4aef75 100644 --- a/src/cloudflare/types/zero_trust/networks/hostname_route_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/hostname_route_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostnameRouteCreateParams"] class HostnameRouteCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/hostname_route_edit_params.py b/src/cloudflare/types/zero_trust/networks/hostname_route_edit_params.py index bdd47d98291..1429767026a 100644 --- a/src/cloudflare/types/zero_trust/networks/hostname_route_edit_params.py +++ b/src/cloudflare/types/zero_trust/networks/hostname_route_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostnameRouteEditParams"] class HostnameRouteEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/hostname_route_list_params.py b/src/cloudflare/types/zero_trust/networks/hostname_route_list_params.py index 34d5a5c09ee..cda69373764 100644 --- a/src/cloudflare/types/zero_trust/networks/hostname_route_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/hostname_route_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HostnameRouteListParams"] class HostnameRouteListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" id: str diff --git a/src/cloudflare/types/zero_trust/networks/route_create_params.py b/src/cloudflare/types/zero_trust/networks/route_create_params.py index aa74c4ec181..635da63698f 100644 --- a/src/cloudflare/types/zero_trust/networks/route_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_create_params.py @@ -8,7 +8,7 @@ class RouteCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" network: Required[str] diff --git a/src/cloudflare/types/zero_trust/networks/route_edit_params.py b/src/cloudflare/types/zero_trust/networks/route_edit_params.py index 266bea9a463..5d0a383e5f0 100644 --- a/src/cloudflare/types/zero_trust/networks/route_edit_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["RouteEditParams"] class RouteEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/route_list_params.py b/src/cloudflare/types/zero_trust/networks/route_list_params.py index 1496ed784fa..3d1b86f0b2c 100644 --- a/src/cloudflare/types/zero_trust/networks/route_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/route_list_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["RouteListParams"] class RouteListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/routes/ip_get_params.py b/src/cloudflare/types/zero_trust/networks/routes/ip_get_params.py index 4269be34d5f..b2b941639c2 100644 --- a/src/cloudflare/types/zero_trust/networks/routes/ip_get_params.py +++ b/src/cloudflare/types/zero_trust/networks/routes/ip_get_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["IPGetParams"] class IPGetParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" default_virtual_network_fallback: bool diff --git a/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py b/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py index 41bd04a5b18..f33811b5e5e 100644 --- a/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/routes/network_create_params.py @@ -8,7 +8,7 @@ class NetworkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" tunnel_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py b/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py index f2a45de26be..c99764abdd3 100644 --- a/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py +++ b/src/cloudflare/types/zero_trust/networks/routes/network_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["NetworkDeleteParams"] class NetworkDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" tun_type: Literal["cfd_tunnel", "warp_connector", "warp", "magic", "ip_sec", "gre", "cni"] diff --git a/src/cloudflare/types/zero_trust/networks/subnet_list_params.py b/src/cloudflare/types/zero_trust/networks/subnet_list_params.py index 929fbd30c21..ef5475b16ad 100644 --- a/src/cloudflare/types/zero_trust/networks/subnet_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/subnet_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["SubnetListParams"] class SubnetListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" address_family: Literal["v4", "v6"] diff --git a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py index 08ec75be53b..a45818011ea 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudflareSourceUpdateParams"] class CloudflareSourceUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py index d8cf3dbb8ec..e9ea45f0951 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py @@ -8,7 +8,7 @@ class WARPCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: Required[str] diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py index 0e94244cfcd..d38b538fda5 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WARPEditParams"] class WARPEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py b/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py index 22a5a599c90..2ffa581aed1 100644 --- a/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py +++ b/src/cloudflare/types/zero_trust/networks/virtual_network_create_params.py @@ -8,7 +8,7 @@ class VirtualNetworkCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: Required[str] diff --git a/src/cloudflare/types/zero_trust/networks/virtual_network_edit_params.py b/src/cloudflare/types/zero_trust/networks/virtual_network_edit_params.py index 340ae7ae2e0..920ec9b111f 100644 --- a/src/cloudflare/types/zero_trust/networks/virtual_network_edit_params.py +++ b/src/cloudflare/types/zero_trust/networks/virtual_network_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["VirtualNetworkEditParams"] class VirtualNetworkEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" comment: str diff --git a/src/cloudflare/types/zero_trust/networks/virtual_network_list_params.py b/src/cloudflare/types/zero_trust/networks/virtual_network_list_params.py index 8de49750c34..116077ae8be 100644 --- a/src/cloudflare/types/zero_trust/networks/virtual_network_list_params.py +++ b/src/cloudflare/types/zero_trust/networks/virtual_network_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["VirtualNetworkListParams"] class VirtualNetworkListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" id: str diff --git a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py index 85c122f487c..4bb1bb7a67a 100644 --- a/src/cloudflare/types/zero_trust/organizations/doh_update_params.py +++ b/src/cloudflare/types/zero_trust/organizations/doh_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DOHUpdateParams"] class DOHUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" doh_jwt_duration: str diff --git a/src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_params.py b/src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_params.py index 0213b5a1666..6caa1e31244 100644 --- a/src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_params.py +++ b/src/cloudflare/types/zero_trust/risk_scoring/behaviour_update_params.py @@ -9,7 +9,7 @@ class BehaviourUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] behaviors: Required[Dict[str, Behaviors]] diff --git a/src/cloudflare/types/zero_trust/risk_scoring/integration_create_params.py b/src/cloudflare/types/zero_trust/risk_scoring/integration_create_params.py index 08a921cbdee..e572a4b3ed1 100644 --- a/src/cloudflare/types/zero_trust/risk_scoring/integration_create_params.py +++ b/src/cloudflare/types/zero_trust/risk_scoring/integration_create_params.py @@ -9,7 +9,7 @@ class IntegrationCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] integration_type: Required[Literal["Okta"]] diff --git a/src/cloudflare/types/zero_trust/risk_scoring/integration_update_params.py b/src/cloudflare/types/zero_trust/risk_scoring/integration_update_params.py index 237270137a5..44bcbbc8308 100644 --- a/src/cloudflare/types/zero_trust/risk_scoring/integration_update_params.py +++ b/src/cloudflare/types/zero_trust/risk_scoring/integration_update_params.py @@ -9,7 +9,7 @@ class IntegrationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] active: Required[bool] """Whether this integration is enabled. diff --git a/src/cloudflare/types/zero_trust/seat_edit_params.py b/src/cloudflare/types/zero_trust/seat_edit_params.py index fcb033e9699..34e26899551 100644 --- a/src/cloudflare/types/zero_trust/seat_edit_params.py +++ b/src/cloudflare/types/zero_trust/seat_edit_params.py @@ -9,7 +9,7 @@ class SeatEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" body: Required[Iterable[Body]] diff --git a/src/cloudflare/types/zero_trust/tunnel_list_params.py b/src/cloudflare/types/zero_trust/tunnel_list_params.py index addfa62a7ca..cd805857059 100644 --- a/src/cloudflare/types/zero_trust/tunnel_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnel_list_params.py @@ -4,7 +4,7 @@ from typing import List, Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ..._utils import PropertyInfo @@ -12,7 +12,7 @@ class TunnelListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" exclude_prefix: str diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py index 176a8de8072..a1a79a2a334 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/configuration_update_params.py @@ -20,7 +20,7 @@ class ConfigurationUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Identifier.""" config: Config diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py index 23a8d63f5cf..b40d7b56a22 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/connection_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ConnectionDeleteParams"] class ConnectionDeleteParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" client_id: str diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py index 9d2105f01bd..b151c2b8600 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared/management_create_params.py @@ -9,7 +9,7 @@ class ManagementCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" resources: Required[List[Literal["logs"]]] diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py index d4df6ef4d79..6e77f7c3e75 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_create_params.py @@ -8,7 +8,7 @@ class CloudflaredCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: Required[str] diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py index d6cbc6977f3..ba11c0c1235 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CloudflaredEditParams"] class CloudflaredEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: str diff --git a/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py index c0d8ca2a75d..cd8091795f0 100644 --- a/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/cloudflared_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class CloudflaredListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" exclude_prefix: str diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector/failover_update_params.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector/failover_update_params.py index a363d9c39de..64f182eae95 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector/failover_update_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector/failover_update_params.py @@ -8,7 +8,7 @@ class FailoverUpdateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" client_id: Required[str] diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_params.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_params.py index 5cd53c0bfac..ec86583c773 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_create_params.py @@ -8,7 +8,7 @@ class WARPConnectorCreateParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: Required[str] diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_params.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_params.py index 6035605ceec..86d2f3b97b9 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["WARPConnectorEditParams"] class WARPConnectorEditParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" name: str diff --git a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py index b981f14fd69..a3b8aa866a9 100644 --- a/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py +++ b/src/cloudflare/types/zero_trust/tunnels/warp_connector_list_params.py @@ -4,7 +4,7 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Annotated, TypedDict +from typing_extensions import Literal, Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -12,7 +12,7 @@ class WARPConnectorListParams(TypedDict, total=False): - account_id: str + account_id: Required[str] """Cloudflare account ID""" exclude_prefix: str diff --git a/src/cloudflare/types/zones/custom_nameserver_update_params.py b/src/cloudflare/types/zones/custom_nameserver_update_params.py index 8e558982ef8..0bf2a635c70 100644 --- a/src/cloudflare/types/zones/custom_nameserver_update_params.py +++ b/src/cloudflare/types/zones/custom_nameserver_update_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CustomNameserverUpdateParams"] class CustomNameserverUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" enabled: bool diff --git a/src/cloudflare/types/zones/environment_create_params.py b/src/cloudflare/types/zones/environment_create_params.py index 3400dfb8834..ea384561f63 100644 --- a/src/cloudflare/types/zones/environment_create_params.py +++ b/src/cloudflare/types/zones/environment_create_params.py @@ -11,7 +11,7 @@ class EnvironmentCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] environments: Required[Iterable[Environment]] diff --git a/src/cloudflare/types/zones/environment_edit_params.py b/src/cloudflare/types/zones/environment_edit_params.py index 5660d0e26f5..54aa7ffa214 100644 --- a/src/cloudflare/types/zones/environment_edit_params.py +++ b/src/cloudflare/types/zones/environment_edit_params.py @@ -11,7 +11,7 @@ class EnvironmentEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] environments: Required[Iterable[Environment]] diff --git a/src/cloudflare/types/zones/environment_update_params.py b/src/cloudflare/types/zones/environment_update_params.py index 98e07ac3176..7cb409fe6f8 100644 --- a/src/cloudflare/types/zones/environment_update_params.py +++ b/src/cloudflare/types/zones/environment_update_params.py @@ -11,7 +11,7 @@ class EnvironmentUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] environments: Required[Iterable[Environment]] diff --git a/src/cloudflare/types/zones/hold_create_params.py b/src/cloudflare/types/zones/hold_create_params.py index ace239a7696..addb06f3ca2 100644 --- a/src/cloudflare/types/zones/hold_create_params.py +++ b/src/cloudflare/types/zones/hold_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HoldCreateParams"] class HoldCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" include_subdomains: bool diff --git a/src/cloudflare/types/zones/hold_delete_params.py b/src/cloudflare/types/zones/hold_delete_params.py index 6ce5383d89a..3610944f01b 100644 --- a/src/cloudflare/types/zones/hold_delete_params.py +++ b/src/cloudflare/types/zones/hold_delete_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HoldDeleteParams"] class HoldDeleteParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hold_after: str diff --git a/src/cloudflare/types/zones/hold_edit_params.py b/src/cloudflare/types/zones/hold_edit_params.py index fcddff40b8e..6c86882616b 100644 --- a/src/cloudflare/types/zones/hold_edit_params.py +++ b/src/cloudflare/types/zones/hold_edit_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["HoldEditParams"] class HoldEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier.""" hold_after: str diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py index f9d3344faf2..7151cf62b94 100644 --- a/src/cloudflare/types/zones/setting_edit_params.py +++ b/src/cloudflare/types/zones/setting_edit_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Union -from typing_extensions import TypeAlias, TypedDict +from typing_extensions import Required, TypeAlias, TypedDict from ..._types import SequenceNotStr from .automatic_platform_optimization_param import AutomaticPlatformOptimizationParam @@ -21,7 +21,7 @@ class Variant0(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" enabled: bool @@ -29,7 +29,7 @@ class Variant0(TypedDict, total=False): class Variant1(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" value: Variant1Value diff --git a/src/cloudflare/types/zones/subscription_create_params.py b/src/cloudflare/types/zones/subscription_create_params.py index 8398616d270..e4ceb39bcc8 100644 --- a/src/cloudflare/types/zones/subscription_create_params.py +++ b/src/cloudflare/types/zones/subscription_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..shared_params.rate_plan import RatePlan @@ -10,7 +10,7 @@ class SubscriptionCreateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" frequency: Literal["weekly", "monthly", "quarterly", "yearly"] diff --git a/src/cloudflare/types/zones/subscription_update_params.py b/src/cloudflare/types/zones/subscription_update_params.py index 03925833fe1..f6b2ae0ac96 100644 --- a/src/cloudflare/types/zones/subscription_update_params.py +++ b/src/cloudflare/types/zones/subscription_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..shared_params.rate_plan import RatePlan @@ -10,7 +10,7 @@ class SubscriptionUpdateParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" frequency: Literal["weekly", "monthly", "quarterly", "yearly"] diff --git a/src/cloudflare/types/zones/zone_edit_params.py b/src/cloudflare/types/zones/zone_edit_params.py index 09495085630..607b488c29e 100644 --- a/src/cloudflare/types/zones/zone_edit_params.py +++ b/src/cloudflare/types/zones/zone_edit_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr @@ -10,7 +10,7 @@ class ZoneEditParams(TypedDict, total=False): - zone_id: str + zone_id: Required[str] """Identifier""" paused: bool diff --git a/tests/api_resources/cache/test_origin_cloud_regions.py b/tests/api_resources/cache/test_origin_cloud_regions.py new file mode 100644 index 00000000000..53a5c9bf953 --- /dev/null +++ b/tests/api_resources/cache/test_origin_cloud_regions.py @@ -0,0 +1,829 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.cache import ( + OriginCloudRegionGetResponse, + OriginCloudRegionEditResponse, + OriginCloudRegionListResponse, + OriginCloudRegionCreateResponse, + OriginCloudRegionDeleteResponse, + OriginCloudRegionBulkEditResponse, + OriginCloudRegionBulkDeleteResponse, + OriginCloudRegionSupportedRegionsResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestOriginCloudRegions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.create( + zone_id="", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.cache.origin_cloud_regions.with_raw_response.list( + zone_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="192.0.2.1", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `origin_ip` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_bulk_delete(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_bulk_delete(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_bulk_delete(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.bulk_delete( + zone_id="", + ) + + @parametrize + def test_method_bulk_edit(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_bulk_edit(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_bulk_edit(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_bulk_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.bulk_edit( + zone_id="", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + 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.cache.origin_cloud_regions.with_raw_response.edit( + zone_id="", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.cache.origin_cloud_regions.with_raw_response.get( + origin_ip="192.0.2.1", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `origin_ip` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.get( + origin_ip="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_supported_regions(self, client: Cloudflare) -> None: + origin_cloud_region = client.cache.origin_cloud_regions.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_raw_response_supported_regions(self, client: Cloudflare) -> None: + response = client.cache.origin_cloud_regions.with_raw_response.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = response.parse() + assert_matches_type(Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"]) + + @parametrize + def test_streaming_response_supported_regions(self, client: Cloudflare) -> None: + with client.cache.origin_cloud_regions.with_streaming_response.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = response.parse() + assert_matches_type( + Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_supported_regions(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.cache.origin_cloud_regions.with_raw_response.supported_regions( + zone_id="", + ) + + +class TestAsyncOriginCloudRegions: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionCreateResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.cache.origin_cloud_regions.with_raw_response.create( + zone_id="", + ip="192.0.2.1", + region="us-east-1", + vendor="aws", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionListResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.cache.origin_cloud_regions.with_raw_response.list( + zone_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.delete( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionDeleteResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="192.0.2.1", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `origin_ip` but received ''"): + await async_client.cache.origin_cloud_regions.with_raw_response.delete( + origin_ip="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_bulk_delete(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.bulk_delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkDeleteResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_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.cache.origin_cloud_regions.with_raw_response.bulk_delete( + zone_id="", + ) + + @parametrize + async def test_method_bulk_edit(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_bulk_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.bulk_edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionBulkEditResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_bulk_edit(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.origin_cloud_regions.with_raw_response.bulk_edit( + zone_id="", + body=[ + { + "ip": "192.0.2.1", + "region": "us-east-1", + "vendor": "aws", + }, + { + "ip": "2001:db8::1", + "region": "us-central1", + "vendor": "gcp", + }, + ], + ) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.edit( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionEditResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(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.origin_cloud_regions.with_raw_response.edit( + zone_id="", + ip="2001:db8::1", + region="us-central1", + vendor="gcp", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.get( + origin_ip="192.0.2.1", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionGetResponse], origin_cloud_region, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(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.origin_cloud_regions.with_raw_response.get( + origin_ip="192.0.2.1", + zone_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `origin_ip` but received ''"): + await async_client.cache.origin_cloud_regions.with_raw_response.get( + origin_ip="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_supported_regions(self, async_client: AsyncCloudflare) -> None: + origin_cloud_region = await async_client.cache.origin_cloud_regions.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_raw_response_supported_regions(self, async_client: AsyncCloudflare) -> None: + response = await async_client.cache.origin_cloud_regions.with_raw_response.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin_cloud_region = await response.parse() + assert_matches_type(Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"]) + + @parametrize + async def test_streaming_response_supported_regions(self, async_client: AsyncCloudflare) -> None: + async with async_client.cache.origin_cloud_regions.with_streaming_response.supported_regions( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin_cloud_region = await response.parse() + assert_matches_type( + Optional[OriginCloudRegionSupportedRegionsResponse], origin_cloud_region, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_supported_regions(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.origin_cloud_regions.with_raw_response.supported_regions( + zone_id="", + ) diff --git a/tests/api_resources/iam/test_user_groups.py b/tests/api_resources/iam/test_user_groups.py index f3fd0402f8a..276cf430849 100644 --- a/tests/api_resources/iam/test_user_groups.py +++ b/tests/api_resources/iam/test_user_groups.py @@ -26,6 +26,14 @@ class TestUserGroups: @parametrize def test_method_create(self, client: Cloudflare) -> None: + user_group = client.iam.user_groups.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + ) + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: user_group = client.iam.user_groups.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", @@ -47,16 +55,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.iam.user_groups.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) assert response.is_closed is True @@ -69,16 +67,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.iam.user_groups.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,16 +82,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.iam.user_groups.with_raw_response.create( account_id="", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) @parametrize @@ -190,7 +168,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: fuzzy_name="Foo", name="NameOfTheUserGroup", page=1, - per_page=5, + per_page=1, ) assert_matches_type(SyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) @@ -329,6 +307,14 @@ class TestAsyncUserGroups: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: + user_group = await async_client.iam.user_groups.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + name="My New User Group", + ) + assert_matches_type(Optional[UserGroupCreateResponse], user_group, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: user_group = await async_client.iam.user_groups.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", @@ -350,16 +336,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.user_groups.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) assert response.is_closed is True @@ -372,16 +348,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.iam.user_groups.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -397,16 +363,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.iam.user_groups.with_raw_response.create( account_id="", name="My New User Group", - policies=[ - { - "access": "allow", - "permission_groups": [ - {"id": "c8fed203ed3043cba015a93ad1616f1f"}, - {"id": "82e64a83756745bbbb1c9c2701bf816b"}, - ], - "resource_groups": [{"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1"}], - } - ], ) @parametrize @@ -493,7 +449,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) fuzzy_name="Foo", name="NameOfTheUserGroup", page=1, - per_page=5, + per_page=1, ) assert_matches_type(AsyncV4PagePaginationArray[UserGroupListResponse], user_group, path=["response"]) diff --git a/tests/api_resources/iam/user_groups/test_members.py b/tests/api_resources/iam/user_groups/test_members.py index 603db00d3d0..34f95676d7b 100644 --- a/tests/api_resources/iam/user_groups/test_members.py +++ b/tests/api_resources/iam/user_groups/test_members.py @@ -11,6 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from cloudflare.types.iam.user_groups import ( + MemberGetResponse, MemberListResponse, MemberCreateResponse, MemberDeleteResponse, @@ -28,35 +29,35 @@ def test_method_create(self, client: Cloudflare) -> None: member = client.iam.user_groups.members.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(SyncSinglePage[MemberCreateResponse], member, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.iam.user_groups.members.with_raw_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = response.parse() - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(SyncSinglePage[MemberCreateResponse], member, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.iam.user_groups.members.with_streaming_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = response.parse() - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(SyncSinglePage[MemberCreateResponse], member, path=["response"]) assert cast(Any, response.is_closed) is True @@ -66,14 +67,14 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.iam.user_groups.members.with_raw_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): client.iam.user_groups.members.with_raw_response.create( user_group_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) @parametrize @@ -81,7 +82,7 @@ def test_method_update(self, client: Cloudflare) -> None: member = client.iam.user_groups.members.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert_matches_type(SyncSinglePage[MemberUpdateResponse], member, path=["response"]) @@ -90,7 +91,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: response = client.iam.user_groups.members.with_raw_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert response.is_closed is True @@ -103,7 +104,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: with client.iam.user_groups.members.with_streaming_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -119,14 +120,14 @@ def test_path_params_update(self, client: Cloudflare) -> None: client.iam.user_groups.members.with_raw_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): client.iam.user_groups.members.with_raw_response.update( user_group_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) @parametrize @@ -142,6 +143,8 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: member = client.iam.user_groups.members.list( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="asc", + fuzzy_email="user@", page=1, per_page=1, ) @@ -247,6 +250,66 @@ def test_path_params_delete(self, client: Cloudflare) -> None: user_group_id="023e105f4ecef8ad9ca31a8372d0c353", ) + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + member = client.iam.user_groups.members.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = response.parse() + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.iam.user_groups.members.with_streaming_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = response.parse() + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @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.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + client.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): + client.iam.user_groups.members.with_raw_response.get( + member_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + class TestAsyncMembers: parametrize = pytest.mark.parametrize( @@ -258,35 +321,35 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: member = await async_client.iam.user_groups.members.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(AsyncSinglePage[MemberCreateResponse], member, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.user_groups.members.with_raw_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = await response.parse() - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(AsyncSinglePage[MemberCreateResponse], member, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.iam.user_groups.members.with_streaming_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" member = await response.parse() - assert_matches_type(Optional[MemberCreateResponse], member, path=["response"]) + assert_matches_type(AsyncSinglePage[MemberCreateResponse], member, path=["response"]) assert cast(Any, response.is_closed) is True @@ -296,14 +359,14 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.iam.user_groups.members.with_raw_response.create( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): await async_client.iam.user_groups.members.with_raw_response.create( user_group_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) @parametrize @@ -311,7 +374,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: member = await async_client.iam.user_groups.members.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert_matches_type(AsyncSinglePage[MemberUpdateResponse], member, path=["response"]) @@ -320,7 +383,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.iam.user_groups.members.with_raw_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) assert response.is_closed is True @@ -333,7 +396,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> async with async_client.iam.user_groups.members.with_streaming_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -349,14 +412,14 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: await async_client.iam.user_groups.members.with_raw_response.update( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): await async_client.iam.user_groups.members.with_raw_response.update( user_group_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", - body=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], + members=[{"id": "023e105f4ecef8ad9ca31a8372d0c353"}], ) @parametrize @@ -372,6 +435,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) member = await async_client.iam.user_groups.members.list( user_group_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + direction="asc", + fuzzy_email="user@", page=1, per_page=1, ) @@ -476,3 +541,63 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", user_group_id="023e105f4ecef8ad9ca31a8372d0c353", ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + member = await async_client.iam.user_groups.members.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + member = await response.parse() + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.iam.user_groups.members.with_streaming_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + member = await response.parse() + assert_matches_type(Optional[MemberGetResponse], member, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_group_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.get( + member_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `member_id` but received ''"): + await async_client.iam.user_groups.members.with_raw_response.get( + member_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + user_group_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/logpush/test_jobs.py b/tests/api_resources/logpush/test_jobs.py index 862caad9f98..465a81c9b56 100644 --- a/tests/api_resources/logpush/test_jobs.py +++ b/tests/api_resources/logpush/test_jobs.py @@ -49,6 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "cve_2021_44228": False, "field_delimiter": ",", "field_names": ["Datetime", "DstIP", "SrcIP"], + "merge_subrequests": True, "output_type": "ndjson", "record_delimiter": "", "record_prefix": "{", @@ -135,6 +136,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "cve_2021_44228": False, "field_delimiter": ",", "field_names": ["Datetime", "DstIP", "SrcIP"], + "merge_subrequests": True, "output_type": "ndjson", "record_delimiter": "", "record_prefix": "{", @@ -404,6 +406,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "cve_2021_44228": False, "field_delimiter": ",", "field_names": ["Datetime", "DstIP", "SrcIP"], + "merge_subrequests": True, "output_type": "ndjson", "record_delimiter": "", "record_prefix": "{", @@ -490,6 +493,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "cve_2021_44228": False, "field_delimiter": ",", "field_names": ["Datetime", "DstIP", "SrcIP"], + "merge_subrequests": True, "output_type": "ndjson", "record_delimiter": "", "record_prefix": "{", diff --git a/tests/api_resources/organizations/logs/__init__.py b/tests/api_resources/organizations/logs/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/organizations/logs/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/organizations/logs/test_audit.py b/tests/api_resources/organizations/logs/test_audit.py new file mode 100644 index 00000000000..44322e0a484 --- /dev/null +++ b/tests/api_resources/organizations/logs/test_audit.py @@ -0,0 +1,188 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date +from cloudflare.pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from cloudflare.types.organizations.logs import AuditListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAudit: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + audit = client.organizations.logs.audit.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + audit = client.organizations.logs.audit.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + id={"not": ["f174be97-19b1-40d6-954d-70cd5fbd52db"]}, + action_result={"not": ["success"]}, + action_type={"not": ["create"]}, + actor_context={"not": ["api_key"]}, + actor_email={"not": ["alice@example.com"]}, + actor_id={"not": ["1d20c3afe174f18b642710cec6298a9d"]}, + actor_ip_address={"not": ["17.168.228.63"]}, + actor_token_id={"not": ["144cdb2e39c55e203cf225d8d8208647"]}, + actor_token_name={"not": ["Test Token"]}, + actor_type={"not": ["user"]}, + cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", + direction="desc", + limit=25, + raw_cf_rayid={"not": ["8e8dd2156ef28414"]}, + raw_method={"not": ["GET"]}, + raw_status_code={"not": [200]}, + raw_uri={"not": ["string"]}, + resource_id={"not": ["string"]}, + resource_product={"not": ["Stream"]}, + resource_scope={"not": ["organizations"]}, + resource_type={"not": ["Video"]}, + ) + assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.organizations.logs.audit.with_raw_response.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + audit = response.parse() + assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.organizations.logs.audit.with_streaming_response.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + audit = response.parse() + assert_matches_type(SyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + client.organizations.logs.audit.with_raw_response.list( + organization_id="", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + +class TestAsyncAudit: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + audit = await async_client.organizations.logs.audit.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + audit = await async_client.organizations.logs.audit.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + id={"not": ["f174be97-19b1-40d6-954d-70cd5fbd52db"]}, + action_result={"not": ["success"]}, + action_type={"not": ["create"]}, + actor_context={"not": ["api_key"]}, + actor_email={"not": ["alice@example.com"]}, + actor_id={"not": ["1d20c3afe174f18b642710cec6298a9d"]}, + actor_ip_address={"not": ["17.168.228.63"]}, + actor_token_id={"not": ["144cdb2e39c55e203cf225d8d8208647"]}, + actor_token_name={"not": ["Test Token"]}, + actor_type={"not": ["user"]}, + cursor="Q1buH-__DQqqig7SVYXT-SsMOTGY2Z3Y80W-fGgva7yaDdmPKveucH5ddOcHsJRhNb-xUK8agZQqkJSMAENGO8NU6g==", + direction="desc", + limit=25, + raw_cf_rayid={"not": ["8e8dd2156ef28414"]}, + raw_method={"not": ["GET"]}, + raw_status_code={"not": [200]}, + raw_uri={"not": ["string"]}, + resource_id={"not": ["string"]}, + resource_product={"not": ["Stream"]}, + resource_scope={"not": ["organizations"]}, + resource_type={"not": ["Video"]}, + ) + assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.organizations.logs.audit.with_raw_response.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + audit = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.organizations.logs.audit.with_streaming_response.list( + organization_id="a67e14daa5f8dceeb91fe5449ba496ef", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + audit = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[AuditListResponse], audit, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: required params 'since' and 'before' not populated by Prism mock") + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `organization_id` but received ''"): + await async_client.organizations.logs.audit.with_raw_response.list( + organization_id="", + before=parse_date("2024-10-31"), + since=parse_date("2024-10-30"), + ) diff --git a/tests/api_resources/organizations/test_organization_profile.py b/tests/api_resources/organizations/test_organization_profile.py index a35af6ef2da..769bf2368a8 100644 --- a/tests/api_resources/organizations/test_organization_profile.py +++ b/tests/api_resources/organizations/test_organization_profile.py @@ -9,9 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.organizations.organization_profile_get_params import ( # pyright: ignore[reportMissingImports] - Result, # pyright: ignore[reportUnknownVariableType] -) +from cloudflare.types.organizations.organization_profile_get_params import Result base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -79,32 +77,32 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: - organization_profile = client.organizations.organization_profile.get( # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType] + organization_profile = client.organizations.organization_profile.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", ) - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + assert_matches_type(Result, organization_profile, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.organizations.organization_profile.with_raw_response.get( # pyright: ignore[reportUnknownVariableType] + response = client.organizations.organization_profile.with_raw_response.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization_profile = response.parse() # pyright: ignore[reportUnknownVariableType] - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + organization_profile = response.parse() + assert_matches_type(Result, organization_profile, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.organizations.organization_profile.with_streaming_response.get( # pyright: ignore[reportUnknownVariableType] + with client.organizations.organization_profile.with_streaming_response.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", - ) as response: # pyright: ignore[reportUnknownVariableType] + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization_profile = response.parse() # pyright: ignore[reportUnknownVariableType] - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + organization_profile = response.parse() + assert_matches_type(Result, organization_profile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,32 +179,32 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - organization_profile = await async_client.organizations.organization_profile.get( # pyright: ignore[reportUnknownVariableType, reportUnknownMemberType] + organization_profile = await async_client.organizations.organization_profile.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", ) - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + assert_matches_type(Result, organization_profile, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.organizations.organization_profile.with_raw_response.get( # pyright: ignore[reportUnknownVariableType] + response = await async_client.organizations.organization_profile.with_raw_response.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization_profile = await response.parse() # pyright: ignore[reportUnknownVariableType] - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + organization_profile = await response.parse() + assert_matches_type(Result, organization_profile, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.organizations.organization_profile.with_streaming_response.get( # pyright: ignore[reportUnknownVariableType] + async with async_client.organizations.organization_profile.with_streaming_response.get( "a7b9c3d2e8f4g1h5i6j0k9l2m3n7o4p8", - ) as response: # pyright: ignore[reportUnknownVariableType] + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - organization_profile = await response.parse() # pyright: ignore[reportUnknownVariableType] - assert_matches_type(Result, organization_profile, path=["response"]) # pyright: ignore[reportUnknownArgumentType] + organization_profile = await response.parse() + assert_matches_type(Result, organization_profile, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/registrar/test_registrations.py b/tests/api_resources/registrar/test_registrations.py index 900a0056e63..74074924a6d 100644 --- a/tests/api_resources/registrar/test_registrations.py +++ b/tests/api_resources/registrar/test_registrations.py @@ -142,7 +142,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize def test_method_edit(self, client: Cloudflare) -> None: registration = client.registrar.registrations.edit( @@ -151,6 +151,7 @@ def test_method_edit(self, client: Cloudflare) -> None: ) assert_matches_type(WorkflowStatus, registration, path=["response"]) + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: registration = client.registrar.registrations.edit( @@ -161,7 +162,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(WorkflowStatus, registration, path=["response"]) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.registrar.registrations.with_raw_response.edit( @@ -174,7 +175,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: registration = response.parse() assert_matches_type(WorkflowStatus, registration, path=["response"]) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.registrar.registrations.with_streaming_response.edit( @@ -189,6 +190,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize 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 ''"): @@ -378,7 +380,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: account_id="", ) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: registration = await async_client.registrar.registrations.edit( @@ -387,6 +389,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(WorkflowStatus, registration, path=["response"]) + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: registration = await async_client.registrar.registrations.edit( @@ -397,7 +400,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) ) assert_matches_type(WorkflowStatus, registration, path=["response"]) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.registrar.registrations.with_raw_response.edit( @@ -410,7 +413,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: registration = await response.parse() assert_matches_type(WorkflowStatus, registration, path=["response"]) - @pytest.mark.skip(reason="test sends empty body but OpenAPI spec requires minProperties: 1") + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.registrar.registrations.with_streaming_response.edit( @@ -425,6 +428,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422: Prism mock rejects test fixture domain with 'Domain not found'") @parametrize async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): diff --git a/tests/api_resources/test_bot_management.py b/tests/api_resources/test_bot_management.py index bffba58aeef..3ed0138edef 100644 --- a/tests/api_resources/test_bot_management.py +++ b/tests/api_resources/test_bot_management.py @@ -33,6 +33,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, fight_mode=True, @@ -84,6 +85,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, @@ -138,6 +140,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, @@ -195,6 +198,7 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N auto_update_model=True, bm_cookie_enabled=True, cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, @@ -290,6 +294,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, fight_mode=True, @@ -341,6 +346,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, @@ -395,6 +401,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn zone_id="023e105f4ecef8ad9ca31a8372d0c353", ai_bots_protection="block", cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, @@ -452,6 +459,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn auto_update_model=True, bm_cookie_enabled=True, cf_robots_variant="policy_only", + content_bots_protection="disabled", crawler_protection="enabled", enable_js=True, is_robots_txt_managed=False, diff --git a/tests/api_resources/workflows/instances/test_status.py b/tests/api_resources/workflows/instances/test_status.py index 5b7e8ff5db9..6cf1e77a82d 100644 --- a/tests/api_resources/workflows/instances/test_status.py +++ b/tests/api_resources/workflows/instances/test_status.py @@ -27,6 +27,21 @@ def test_method_edit(self, client: Cloudflare) -> None: ) assert_matches_type(StatusEditResponse, status, path=["response"]) + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + status = client.workflows.instances.status.edit( + instance_id="x", + account_id="account_id", + workflow_name="x", + status="resume", + from_={ + "name": "x", + "count": 1, + "type": "do", + }, + ) + assert_matches_type(StatusEditResponse, status, path=["response"]) + @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.workflows.instances.status.with_raw_response.edit( @@ -99,6 +114,21 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(StatusEditResponse, status, path=["response"]) + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + status = await async_client.workflows.instances.status.edit( + instance_id="x", + account_id="account_id", + workflow_name="x", + status="resume", + from_={ + "name": "x", + "count": 1, + "type": "do", + }, + ) + assert_matches_type(StatusEditResponse, status, path=["response"]) + @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.workflows.instances.status.with_raw_response.edit( diff --git a/tests/api_resources/zero_trust/gateway/test_rules.py b/tests/api_resources/zero_trust/gateway/test_rules.py index e425820ab37..58c1846d958 100644 --- a/tests/api_resources/zero_trust/gateway/test_rules.py +++ b/tests/api_resources/zero_trust/gateway/test_rules.py @@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "printing": "enabled", "upload": "enabled", "version": "v1", + "wm_id": "475345dc-5299-4b6e-8f6a-3d3e4c8e9f1a", }, "block_page": { "target_uri": "https://example.com", @@ -230,6 +231,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "printing": "enabled", "upload": "enabled", "version": "v1", + "wm_id": "475345dc-5299-4b6e-8f6a-3d3e4c8e9f1a", }, "block_page": { "target_uri": "https://example.com", @@ -629,6 +631,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "printing": "enabled", "upload": "enabled", "version": "v1", + "wm_id": "475345dc-5299-4b6e-8f6a-3d3e4c8e9f1a", }, "block_page": { "target_uri": "https://example.com", @@ -793,6 +796,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "printing": "enabled", "upload": "enabled", "version": "v1", + "wm_id": "475345dc-5299-4b6e-8f6a-3d3e4c8e9f1a", }, "block_page": { "target_uri": "https://example.com", diff --git a/tests/test_client.py b/tests/test_client.py index 5a98101a63f..1792b01cb5a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -510,36 +510,6 @@ def test_hardcoded_query_params_in_url(self, client: Cloudflare) -> None: ) assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" - def test_account_id_client_params(self, client: Cloudflare) -> None: - # Test with base client (no custom params) - with pytest.raises(ValueError, match="Missing account_id argument;"): - client.accounts.update(id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", type="standard") - - client = Cloudflare( - base_url=base_url, - api_key=api_key, - api_email=api_email, - _strict_response_validation=True, - account_id="f037e56e89293a057740de681ac9accp", - ) - with client as c2: - c2.accounts.update(id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", type="standard") - - def test_zone_id_client_params(self, client: Cloudflare) -> None: - # Test with base client (no custom params) - with pytest.raises(ValueError, match="Missing zone_id argument;"): - client.zones.delete() - - client = Cloudflare( - base_url=base_url, - api_key=api_key, - api_email=api_email, - _strict_response_validation=True, - zone_id="f037e56e89293a057740de681ac9accp", - ) - with client as c2: - c2.zones.delete() - def test_request_extra_json(self, client: Cloudflare) -> None: request = client._build_request( FinalRequestOptions( @@ -1645,38 +1615,6 @@ async def test_hardcoded_query_params_in_url(self, async_client: AsyncCloudflare ) assert request.url.raw_path == b"/files/a%2Fb?beta=true&limit=10" - async def test_account_id_client_params(self, async_client: AsyncCloudflare) -> None: - # Test with base client (no custom params) - with pytest.raises(ValueError, match="Missing account_id argument;"): - await async_client.accounts.update( - id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", type="standard" - ) - - client = AsyncCloudflare( - base_url=base_url, - api_key=api_key, - api_email=api_email, - _strict_response_validation=True, - account_id="f037e56e89293a057740de681ac9accp", - ) - async with client as c2: - await c2.accounts.update(id="023e105f4ecef8ad9ca31a8372d0c353", name="Demo Account", type="standard") - - async def test_zone_id_client_params(self, async_client: AsyncCloudflare) -> None: - # Test with base client (no custom params) - with pytest.raises(ValueError, match="Missing zone_id argument;"): - await async_client.zones.delete() - - client = AsyncCloudflare( - base_url=base_url, - api_key=api_key, - api_email=api_email, - _strict_response_validation=True, - zone_id="f037e56e89293a057740de681ac9accp", - ) - async with client as c2: - await c2.zones.delete() - def test_request_extra_json(self, client: Cloudflare) -> None: request = client._build_request( FinalRequestOptions(